ChangeEmail   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 22
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 19 1
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