Skip to content

Commit

Permalink
ZF3
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielss89 committed Mar 14, 2018
1 parent 50f084d commit 517ae92
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 3 deletions.
6 changes: 3 additions & 3 deletions config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand All @@ -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' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

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

return $options;
}

public function __invoke(ContainerInterface $container, $requestedName, array $options = NULL)
{
return $this->createService($container);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
}
}

0 comments on commit 517ae92

Please sign in to comment.