Skip to content

Commit 517ae92

Browse files
committed
ZF3
1 parent 50f084d commit 517ae92

File tree

7 files changed

+48
-3
lines changed

7 files changed

+48
-3
lines changed

config/module.config.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
'router' => [
44
'routes' => [
55
'e4w' => [
6-
'type' => 'Zend\Mvc\Router\Http\Literal',
6+
'type' => \Zend\Router\Http\Literal::class,
77
'options' => [
88
'route' => '/'
99
],
1010
'may_terminate' => false,
1111
'child_routes' => [
1212
'zfc-user-forgot-password' => [
13-
'type' => 'Zend\Mvc\Router\Http\Literal',
13+
'type' => \Zend\Router\Http\Literal::class,
1414
'options' => [
1515
'route' => 'forgot-password',
1616
'defaults' => [
@@ -21,7 +21,7 @@
2121
'may_terminate' => true,
2222
'child_routes' => [
2323
'change-password' => [
24-
'type' => 'Zend\Mvc\Router\Http\Segment',
24+
'type' => \Zend\Router\Http\Segment::class,
2525
'options' => [
2626
'route' => '/change-password/:token',
2727
'defaults' => [

src/Eye4web/ZfcUser/ForgotPassword/Factory/Controller/ForgotPasswordControllerFactory.php

+15
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Eye4web\ZfcUser\ForgotPassword\Factory\Controller;
44

55
use Eye4web\ZfcUser\ForgotPassword\Controller\ForgotPasswordController;
6+
use Interop\Container\ContainerInterface;
67
use Zend\ServiceManager\FactoryInterface;
78
use Zend\ServiceManager\ServiceLocatorInterface;
89

@@ -30,4 +31,18 @@ public function createService(ServiceLocatorInterface $controllerManager)
3031

3132
return new ForgotPasswordController($requestForm, $changePassword, $forgotPasswordService);
3233
}
34+
35+
public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL)
36+
{
37+
/** @var \Eye4web\ZfcUser\ForgotPassword\Form\Forgot\RequestForm $requestForm */
38+
$requestForm = $container->get('Eye4web\ZfcUser\ForgotPassword\Form\Forgot\RequestForm');
39+
40+
/** @var \Eye4web\ZfcUser\ForgotPassword\Form\Forgot\ChangePasswordForm $changePassword */
41+
$changePassword = $container->get('Eye4web\ZfcUser\ForgotPassword\Form\Forgot\ChangePasswordForm');
42+
43+
/** @var \Eye4web\ZfcUser\ForgotPassword\Service\ForgotPasswordService $forgotPasswordService */
44+
$forgotPasswordService = $container->get('Eye4web\ZfcUser\ForgotPassword\Service\ForgotPasswordService');
45+
46+
return new ForgotPasswordController($requestForm, $changePassword, $forgotPasswordService);
47+
}
3348
}

src/Eye4web/ZfcUser/ForgotPassword/Factory/Mapper/DoctrineORM/TokenMapperFactory.php

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Eye4web\ZfcUser\ForgotPassword\Factory\Mapper\DoctrineORM;
44

55
use Eye4web\ZfcUser\ForgotPassword\Mapper\DoctrineORM\TokenMapper;
6+
use Interop\Container\ContainerInterface;
67
use Zend\ServiceManager\FactoryInterface;
78
use Zend\ServiceManager\ServiceLocatorInterface;
89

@@ -24,4 +25,9 @@ public function createService(ServiceLocatorInterface $serviceLocator)
2425

2526
return new TokenMapper($objectManager, $moduleOptions);
2627
}
28+
29+
public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL)
30+
{
31+
return $this->createService($container);
32+
}
2733
}

src/Eye4web/ZfcUser/ForgotPassword/Factory/Mapper/DoctrineORM/UserMapperFactory.php

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Eye4web\ZfcUser\ForgotPassword\Factory\Mapper\DoctrineORM;
44

55
use Eye4web\ZfcUser\ForgotPassword\Mapper\DoctrineORM\UserMapper;
6+
use Interop\Container\ContainerInterface;
67
use Zend\ServiceManager\FactoryInterface;
78
use Zend\ServiceManager\ServiceLocatorInterface;
89

@@ -24,4 +25,9 @@ public function createService(ServiceLocatorInterface $serviceLocator)
2425

2526
return new UserMapper($objectManager, $zfcUserModuleOptions);
2627
}
28+
29+
public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL)
30+
{
31+
return $this->createService($container);
32+
}
2733
}

src/Eye4web/ZfcUser/ForgotPassword/Factory/Options/ModuleOptionsFactory.php

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Eye4web\ZfcUser\ForgotPassword\Factory\Options;
44

55
use Eye4web\ZfcUser\ForgotPassword\Options\ModuleOptions;
6+
use Interop\Container\ContainerInterface;
67
use Zend\ServiceManager\FactoryInterface;
78
use Zend\ServiceManager\ServiceLocatorInterface;
89

@@ -28,4 +29,9 @@ public function createService(ServiceLocatorInterface $serviceLocator)
2829

2930
return $options;
3031
}
32+
33+
public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL)
34+
{
35+
return $this->createService($container);
36+
}
3137
}

src/Eye4web/ZfcUser/ForgotPassword/Factory/Service/ForgotPasswordServiceFactory.php

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Eye4web\ZfcUser\ForgotPassword\Factory\Service;
44

55
use Eye4web\ZfcUser\ForgotPassword\Service\ForgotPasswordService;
6+
use Interop\Container\ContainerInterface;
67
use Zend\ServiceManager\FactoryInterface;
78
use Zend\ServiceManager\ServiceLocatorInterface;
89

@@ -33,4 +34,9 @@ public function createService(ServiceLocatorInterface $serviceLocator)
3334

3435
return new ForgotPasswordService($requestForm, $changePassword, $userMapper, $tokenMapper, $mailService);
3536
}
37+
38+
public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL)
39+
{
40+
return $this->createService($container);
41+
}
3642
}

src/Eye4web/ZfcUser/ForgotPassword/Factory/Service/MailServiceFactory.php

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Eye4web\ZfcUser\ForgotPassword\Factory\Service;
44

55
use Eye4web\ZfcUser\ForgotPassword\Service\MailService;
6+
use Interop\Container\ContainerInterface;
67
use Zend\ServiceManager\FactoryInterface;
78
use Zend\ServiceManager\ServiceLocatorInterface;
89

@@ -24,4 +25,9 @@ public function createService(ServiceLocatorInterface $serviceLocator)
2425

2526
return new MailService($mailTransporter);
2627
}
28+
29+
public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL)
30+
{
31+
return $this->createService($container);
32+
}
2733
}

0 commit comments

Comments
 (0)