| Conditions | 6 |
| Paths | 5 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 66 | 2 | private function callOnLocalDef( $definition, $property, $semanticData ) { |
|
| 67 | |||
| 68 | 2 | if ( !isset( $definition['id'] ) || $definition['id'] !== $property->getKey() ) { |
|
| 69 | 1 | return; |
|
| 70 | } |
||
| 71 | |||
| 72 | 1 | $dataItem = null; |
|
| 73 | |||
| 74 | 1 | if ( isset( $definition['callback'] ) && is_callable( $definition['callback'] ) ) { |
|
| 75 | 1 | $dataItem = call_user_func_array( $definition['callback'], array( $this->appFactory, $property, $semanticData ) ); |
|
| 76 | 1 | } |
|
| 77 | |||
| 78 | 1 | if ( $dataItem instanceof DataItem ) { |
|
| 79 | 1 | $semanticData->addPropertyObjectValue( $property, $dataItem ); |
|
| 80 | 1 | } |
|
| 81 | 1 | } |
|
| 82 | |||
| 84 |
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: