この名前空間ってどこにあるんだ?
1645 ワード
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
Author And Source
この問題について(この名前空間ってどこにあるんだ?), 我々は、より多くの情報をここで見つけました https://qiita.com/ryota_adr/items/036bca4163c695f36ff5著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .