ChangeEmail::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 9.6333
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
3
namespace LmcUser\Factory\Form;
4
5
use Interop\Container\ContainerInterface;
6
use Laminas\ServiceManager\Factory\FactoryInterface;
7
use LmcUser\Form;
8
use LmcUser\Validator;
9
10
class ChangeEmail implements FactoryInterface
11
{
12
    public function __invoke(ContainerInterface $serviceManager, $requestedName, array $options = null)
13
    {
14
        $options = $serviceManager->get('lmcuser_module_options');
15
        $form = new Form\ChangeEmail(null, $options);
16
17
        $form->setInputFilter(
18
            new Form\ChangeEmailFilter(
19
                $options,
20
                new Validator\NoRecordExists(
21
                    array(
22
                    'mapper' => $serviceManager->get('lmcuser_user_mapper'),
23
                    'key'    => 'email'
24
                    )
25
                )
26
            )
27
        );
28
29
        return $form;
30
    }
31
}
32