Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 1.0019 |
Changes | 0 |
1 | <?php |
||
46 | 2 | public function configure(RepositoryFactory $factory): RepositoryFactory |
|
47 | { |
||
48 | $this |
||
49 | 2 | ->repositories |
|
50 | 2 | ->foreach(function( |
|
51 | string $class, |
||
52 | RepositoryInterface $repository |
||
53 | ) use ( |
||
54 | $factory |
||
55 | ) { |
||
56 | 1 | $factory->register( |
|
57 | 1 | $this->metadatas->get($class), |
|
58 | $repository |
||
59 | ); |
||
60 | 2 | }); |
|
61 | |||
62 | 2 | return $factory; |
|
63 | } |
||
64 | } |
||
65 |
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: