diff --git a/config/module.config.php b/config/module.config.php index 735ab74..b297f14 100644 --- a/config/module.config.php +++ b/config/module.config.php @@ -3,14 +3,14 @@ 'router' => [ 'routes' => [ 'e4w' => [ - 'type' => 'Zend\Mvc\Router\Http\Literal', + 'type' => \Zend\Router\Http\Literal::class, 'options' => [ 'route' => '/' ], 'may_terminate' => false, 'child_routes' => [ 'zfc-user-forgot-password' => [ - 'type' => 'Zend\Mvc\Router\Http\Literal', + 'type' => \Zend\Router\Http\Literal::class, 'options' => [ 'route' => 'forgot-password', 'defaults' => [ @@ -21,7 +21,7 @@ 'may_terminate' => true, 'child_routes' => [ 'change-password' => [ - 'type' => 'Zend\Mvc\Router\Http\Segment', + 'type' => \Zend\Router\Http\Segment::class, 'options' => [ 'route' => '/change-password/:token', 'defaults' => [ diff --git a/src/Eye4web/ZfcUser/ForgotPassword/Factory/Controller/ForgotPasswordControllerFactory.php b/src/Eye4web/ZfcUser/ForgotPassword/Factory/Controller/ForgotPasswordControllerFactory.php index 9d118ac..4688256 100644 --- a/src/Eye4web/ZfcUser/ForgotPassword/Factory/Controller/ForgotPasswordControllerFactory.php +++ b/src/Eye4web/ZfcUser/ForgotPassword/Factory/Controller/ForgotPasswordControllerFactory.php @@ -3,6 +3,7 @@ namespace Eye4web\ZfcUser\ForgotPassword\Factory\Controller; use Eye4web\ZfcUser\ForgotPassword\Controller\ForgotPasswordController; +use Interop\Container\ContainerInterface; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; @@ -30,4 +31,18 @@ public function createService(ServiceLocatorInterface $controllerManager) return new ForgotPasswordController($requestForm, $changePassword, $forgotPasswordService); } + + public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL) + { + /** @var \Eye4web\ZfcUser\ForgotPassword\Form\Forgot\RequestForm $requestForm */ + $requestForm = $container->get('Eye4web\ZfcUser\ForgotPassword\Form\Forgot\RequestForm'); + + /** @var \Eye4web\ZfcUser\ForgotPassword\Form\Forgot\ChangePasswordForm $changePassword */ + $changePassword = $container->get('Eye4web\ZfcUser\ForgotPassword\Form\Forgot\ChangePasswordForm'); + + /** @var \Eye4web\ZfcUser\ForgotPassword\Service\ForgotPasswordService $forgotPasswordService */ + $forgotPasswordService = $container->get('Eye4web\ZfcUser\ForgotPassword\Service\ForgotPasswordService'); + + return new ForgotPasswordController($requestForm, $changePassword, $forgotPasswordService); + } } diff --git a/src/Eye4web/ZfcUser/ForgotPassword/Factory/Mapper/DoctrineORM/TokenMapperFactory.php b/src/Eye4web/ZfcUser/ForgotPassword/Factory/Mapper/DoctrineORM/TokenMapperFactory.php index 030556b..0127294 100644 --- a/src/Eye4web/ZfcUser/ForgotPassword/Factory/Mapper/DoctrineORM/TokenMapperFactory.php +++ b/src/Eye4web/ZfcUser/ForgotPassword/Factory/Mapper/DoctrineORM/TokenMapperFactory.php @@ -3,6 +3,7 @@ namespace Eye4web\ZfcUser\ForgotPassword\Factory\Mapper\DoctrineORM; use Eye4web\ZfcUser\ForgotPassword\Mapper\DoctrineORM\TokenMapper; +use Interop\Container\ContainerInterface; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; @@ -24,4 +25,9 @@ public function createService(ServiceLocatorInterface $serviceLocator) return new TokenMapper($objectManager, $moduleOptions); } + + public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL) + { + return $this->createService($container); + } } diff --git a/src/Eye4web/ZfcUser/ForgotPassword/Factory/Mapper/DoctrineORM/UserMapperFactory.php b/src/Eye4web/ZfcUser/ForgotPassword/Factory/Mapper/DoctrineORM/UserMapperFactory.php index 6ebc51d..0880646 100644 --- a/src/Eye4web/ZfcUser/ForgotPassword/Factory/Mapper/DoctrineORM/UserMapperFactory.php +++ b/src/Eye4web/ZfcUser/ForgotPassword/Factory/Mapper/DoctrineORM/UserMapperFactory.php @@ -3,6 +3,7 @@ namespace Eye4web\ZfcUser\ForgotPassword\Factory\Mapper\DoctrineORM; use Eye4web\ZfcUser\ForgotPassword\Mapper\DoctrineORM\UserMapper; +use Interop\Container\ContainerInterface; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; @@ -24,4 +25,9 @@ public function createService(ServiceLocatorInterface $serviceLocator) return new UserMapper($objectManager, $zfcUserModuleOptions); } + + public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL) + { + return $this->createService($container); + } } diff --git a/src/Eye4web/ZfcUser/ForgotPassword/Factory/Options/ModuleOptionsFactory.php b/src/Eye4web/ZfcUser/ForgotPassword/Factory/Options/ModuleOptionsFactory.php index 3f130c7..c3f13b4 100644 --- a/src/Eye4web/ZfcUser/ForgotPassword/Factory/Options/ModuleOptionsFactory.php +++ b/src/Eye4web/ZfcUser/ForgotPassword/Factory/Options/ModuleOptionsFactory.php @@ -3,6 +3,7 @@ namespace Eye4web\ZfcUser\ForgotPassword\Factory\Options; use Eye4web\ZfcUser\ForgotPassword\Options\ModuleOptions; +use Interop\Container\ContainerInterface; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; @@ -28,4 +29,9 @@ public function createService(ServiceLocatorInterface $serviceLocator) return $options; } + + public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL) + { + return $this->createService($container); + } } diff --git a/src/Eye4web/ZfcUser/ForgotPassword/Factory/Service/ForgotPasswordServiceFactory.php b/src/Eye4web/ZfcUser/ForgotPassword/Factory/Service/ForgotPasswordServiceFactory.php index cd371c8..72446e3 100644 --- a/src/Eye4web/ZfcUser/ForgotPassword/Factory/Service/ForgotPasswordServiceFactory.php +++ b/src/Eye4web/ZfcUser/ForgotPassword/Factory/Service/ForgotPasswordServiceFactory.php @@ -3,6 +3,7 @@ namespace Eye4web\ZfcUser\ForgotPassword\Factory\Service; use Eye4web\ZfcUser\ForgotPassword\Service\ForgotPasswordService; +use Interop\Container\ContainerInterface; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; @@ -33,4 +34,9 @@ public function createService(ServiceLocatorInterface $serviceLocator) return new ForgotPasswordService($requestForm, $changePassword, $userMapper, $tokenMapper, $mailService); } + + public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL) + { + return $this->createService($container); + } } diff --git a/src/Eye4web/ZfcUser/ForgotPassword/Factory/Service/MailServiceFactory.php b/src/Eye4web/ZfcUser/ForgotPassword/Factory/Service/MailServiceFactory.php index a7c10b8..a59c6c2 100644 --- a/src/Eye4web/ZfcUser/ForgotPassword/Factory/Service/MailServiceFactory.php +++ b/src/Eye4web/ZfcUser/ForgotPassword/Factory/Service/MailServiceFactory.php @@ -3,6 +3,7 @@ namespace Eye4web\ZfcUser\ForgotPassword\Factory\Service; use Eye4web\ZfcUser\ForgotPassword\Service\MailService; +use Interop\Container\ContainerInterface; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; @@ -24,4 +25,9 @@ public function createService(ServiceLocatorInterface $serviceLocator) return new MailService($mailTransporter); } + + public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL) + { + return $this->createService($container); + } }