Conditions | 7 |
Paths | 9 |
Total Lines | 24 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public function loadMetadataForClass(\ReflectionClass $class) |
||
34 | { |
||
35 | $metadata = $this->delegate->loadMetadataForClass($class); |
||
36 | $newMetadata = false; |
||
37 | |||
38 | if (empty($this->extensions)) { |
||
39 | return $metadata; |
||
40 | } |
||
41 | |||
42 | if (null === $metadata) { |
||
43 | $metadata = new ClassMetadata($class->getName()); |
||
44 | $newMetadata = true; |
||
45 | } |
||
46 | |||
47 | foreach ($this->extensions as $extension) { |
||
48 | $extension->decorate($metadata); |
||
|
|||
49 | } |
||
50 | |||
51 | if ($newMetadata && count($metadata->getRelations()) < 1 && count($metadata->getRelationProviders()) < 1) { |
||
52 | $metadata = null; |
||
53 | } |
||
54 | |||
55 | return $metadata; |
||
56 | } |
||
57 | |||
66 |
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: