| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 2 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
| 21 | { |
||
| 22 | 2 | $permissionStrat = new NestedEntityStrategy((new PermissionHydratorFactory())($container, $requestedName)); |
|
| 23 | |||
| 24 | 2 | $hydrator = new ClassMethods(); |
|
| 25 | 2 | $hydrator->addStrategy('user', new NestedEntityStrategy(new ClassMethods())); |
|
| 26 | 2 | $hydrator->addStrategy('owner', new NestedEntityStrategy(new ClassMethods())); |
|
| 27 | 2 | $hydrator->addStrategy( |
|
| 28 | 2 | 'permission', |
|
| 29 | 2 | new DecoratedStrategy($permissionStrat, new NullDecorator()) |
|
| 30 | ); |
||
| 31 | 2 | $hydrator->addStrategy('at', new DateTimeFormatterStrategy()); |
|
| 32 | |||
| 33 | 2 | $hydrator->setNamingStrategy(new MapNamingStrategy([ |
|
| 34 | 2 | 'change_action' => 'changeAction', |
|
| 35 | ], [ |
||
| 36 | 2 | 'changeAction' => 'change_action', |
|
| 37 | ])); |
||
| 38 | |||
| 39 | 2 | return $hydrator; |
|
| 40 | } |
||
| 41 | } |
||
| 42 |