Hacks for migrating from ZF2 to ZF3.
To fast-fix your code before fully moving to ZF3.
use \ZF2TO3\ZF2To3AbstractFactoryTrait;
in abstract factories.use \ZF2TO3\ZF2To3FactoryTrait;
in factories.use \ZF2TO3\ZF2To3ControllerTrait;
in controller itself if it depends on service locator.use \ZF2TO3\ZF2To3ServiceLocatorAwareTrait;
and custom constructor to get rid ofServiceLocatorAware
.- Change controller configurations:
<?php return [ 'controllers' => [ // BEFORE: 'invokables' => [ 'App\Some' => \App\SomeController::class ], // AFTER: 'factories' => [ // Controller should be real class: \App\SomeController::class => \ZF2TO3\ZF2To3ControllerFactory::class ], ], ];
- Read the migration docs and get rid of these hacks!