ray-di /
Ray.Aop
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace Ray\Aop; |
||
| 6 | |||
| 7 | use ReflectionClass; |
||
|
0 ignored issues
–
show
|
|||
| 8 | |||
| 9 | interface CodeGenInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @param ReflectionClass<object> $sourceClass |
||
|
0 ignored issues
–
show
The doc-type
ReflectionClass<object> could not be parsed: Expected "|" or "end of type", but got "<" at position 15. (view supported doc-types)
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types. Loading history...
|
|||
| 13 | */ |
||
| 14 | public function generate(ReflectionClass $sourceClass, BindInterface $bind) : Code; |
||
| 15 | } |
||
| 16 |
Let’s assume that you have a directory layout like this:
. |-- OtherDir | |-- Bar.php | `-- Foo.php `-- SomeDir `-- Foo.phpand let’s assume the following content of
Bar.php:If both files
OtherDir/Foo.phpandSomeDir/Foo.phpare loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.phpHowever, as
OtherDir/Foo.phpdoes not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: