abterphp /
propeller-admin
| 1 | <?php |
||
| 2 | |||
| 3 | use AbterPhp\Admin\Constant\Event as AdminEvent; |
||
| 4 | use AbterPhp\Framework\Constant\Event; |
||
|
0 ignored issues
–
show
|
|||
| 5 | use AbterPhp\Framework\Constant\Module; |
||
| 6 | use AbterPhp\PropellerAdmin\Bootstrappers; |
||
| 7 | use AbterPhp\PropellerAdmin\Events; |
||
| 8 | |||
| 9 | return [ |
||
| 10 | Module::IDENTIFIER => 'AbterPhp\PropellerAdmin', |
||
| 11 | Module::DEPENDENCIES => ['AbterPhp\Admin'], |
||
| 12 | Module::ENABLED => true, |
||
| 13 | Module::HTTP_BOOTSTRAPPERS => [ |
||
| 14 | Bootstrappers\Events\ListenersBootstrapper::class, |
||
| 15 | Bootstrappers\Html\Component\ButtonFactoryBootstrapper::class, |
||
| 16 | ], |
||
| 17 | Module::EVENTS => [ |
||
| 18 | Event::NAVIGATION_READY => [ |
||
| 19 | /** @see \AbterPhp\PropellerAdmin\Events\Listeners\NavigationBuilder::handle */ |
||
| 20 | sprintf('%s@handle', Events\Listeners\NavigationBuilder::class), |
||
| 21 | ], |
||
| 22 | Event::FORM_READY => [ |
||
| 23 | /** @see \AbterPhp\PropellerAdmin\Events\Listeners\FormDecorator::handle */ |
||
| 24 | sprintf('%s@handle', Events\Listeners\FormDecorator::class), |
||
| 25 | ], |
||
| 26 | Event::GRID_READY => [ |
||
| 27 | /** @see \AbterPhp\PropellerAdmin\Events\Listeners\GridDecorator::handle */ |
||
| 28 | sprintf('%s@handle', Events\Listeners\GridDecorator::class), |
||
| 29 | ], |
||
| 30 | AdminEvent::ADMIN_READY => [ |
||
| 31 | /** @see \AbterPhp\PropellerAdmin\Events\Listeners\AdminDecorator::handle */ |
||
| 32 | sprintf('%s@handle', Events\Listeners\AdminDecorator::class), |
||
| 33 | ], |
||
| 34 | AdminEvent::LOGIN_READY => [ |
||
| 35 | /** @see \AbterPhp\PropellerAdmin\Events\Listeners\LoginDecorator::handle */ |
||
| 36 | sprintf('%s@handle', Events\Listeners\LoginDecorator::class), |
||
| 37 | ], |
||
| 38 | ], |
||
| 39 | ]; |
||
| 40 |
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: