1 | <?php |
||
19 | class StorageFactory extends AbstractFactory |
||
20 | { |
||
21 | /** |
||
22 | * {@inheritDoc} |
||
23 | */ |
||
24 | 3 | public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null) |
|
25 | { |
||
26 | 3 | $options = $this->getOptions($container, 'authentication'); |
|
27 | |||
28 | 3 | $objectManager = $options->getObjectManager(); |
|
29 | 3 | if (is_string($objectManager)) { |
|
30 | $options->setObjectManager($container->get($objectManager)); |
||
31 | } |
||
32 | |||
33 | 3 | $storage = $options->getStorage(); |
|
34 | 3 | if (is_string($storage)) { |
|
35 | 3 | $options->setStorage($container->get($storage)); |
|
36 | } |
||
37 | |||
38 | 3 | return new ObjectRepository($options); |
|
|
|||
39 | } |
||
40 | |||
41 | /** |
||
42 | * {@inheritDoc} |
||
43 | * |
||
44 | * @return ObjectRepository |
||
45 | */ |
||
46 | 2 | public function createService(ServiceLocatorInterface $container) |
|
47 | { |
||
48 | 2 | return $this($container, ObjectRepository::class); |
|
49 | } |
||
50 | |||
51 | 3 | public function getOptionsClass() : string |
|
55 | } |
||
56 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: