この名前空間ってどこにあるんだ?


Laravel5.7に入れたbarryvdh/laravel-debugbarのコードを読んでいた時に、use DebugBar\OpenHandler;と書いてあって「namespace DebugBar/なんかどこにも書いてないぞ?」と思っていました。

ですがcomposerが生成したコードを読んでいたら、/vendor/composer/autoload_classmap.phpに書いてありました。

autoload_classmap.php
'DebugBar\\OpenHandler' => $vendorDir . '/maximebf/debugbar/src/DebugBar/OpenHandler.php',

DebugBarから始まるのはmaximebf/debugbarのようですね。
これでコードリーディングが捗るぞい!

追記

もっと簡単な方法がありました。

PHP
use DebugBar\OpenHandler;

echo (new ReflectionClass(DebugBar\OpenHandler::class))->getFileName();

//C:\xampp\htdocs\myapp\laravel58\vendor\maximebf\debugbar\src\DebugBar\OpenHandler.php