Conditions | 1 |
Paths | 1 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
20 | 6 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
21 | { |
||
22 | 6 | $extraction = new ClassMethods(); |
|
23 | 6 | $extraction->addStrategy('created_at', new DateTimeFormatterStrategy()); |
|
24 | 6 | $extraction->addStrategy('due', new DateTimeFormatterStrategy()); |
|
25 | 6 | $extraction->addStrategy('active', new BooleanStrategy(1, 0)); |
|
26 | 6 | $extraction->addStrategy('owner', new NestedEntityStrategy(new ClassMethods())); |
|
27 | 6 | $extraction->addStrategy('hash', $container->get(HashStrategy::class)); |
|
28 | |||
29 | 6 | $extraction->setNamingStrategy(new MapNamingStrategy([ |
|
30 | 6 | 'created_at' => 'createdAt', |
|
31 | 'password' => 'hash', |
||
32 | ], [ |
||
33 | 6 | 'isActive' => 'active', |
|
34 | 'createdAt' => 'created_at', |
||
35 | ])); |
||
36 | |||
37 | 6 | return $extraction; |
|
38 | } |
||
39 | } |
||
40 |