| Conditions | 7 |
| Paths | 8 |
| Total Lines | 26 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 56 |
| Changes | 0 | ||
| 1 | <?php |
||
| 51 | public function addAnnotation( DIProperty $property, SemanticData $semanticData ) { |
||
| 52 | |||
| 53 | $time = microtime( true ); |
||
| 54 | |||
| 55 | $localDefs = $this->appFactory->getOption( 'sespLocalPropertyDefinitions', array() ); |
||
|
|
|||
| 56 | $dataItem = null; |
||
| 57 | |||
| 58 | foreach ( $localDefs as $key => $definition ) { |
||
| 59 | |||
| 60 | if ( !isset( $definition['id'] ) || $definition['id'] !== $property->getKey() ) { |
||
| 61 | continue; |
||
| 62 | } |
||
| 63 | |||
| 64 | if ( isset( $definition['hook'] ) && is_callable( $definition['hook'] ) ) { |
||
| 65 | $dataItem = call_user_func_array( $definition['hook'], array( $this->appFactory, $property, $semanticData ) ); |
||
| 66 | } |
||
| 67 | } |
||
| 68 | |||
| 69 | if ( $dataItem instanceof DataItem ) { |
||
| 70 | $semanticData->addPropertyObjectValue( $property, $dataItem ); |
||
| 71 | } |
||
| 72 | |||
| 73 | $this->appFactory->getLogger()->info( |
||
| 74 | __METHOD__ . ' (procTime in sec: '. ( microtime( true ) - $time ) . ')' |
||
| 75 | ); |
||
| 76 | } |
||
| 77 | |||
| 79 |
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: