| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 2 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 40 | 2 | public function getEntityIdsForTerm( Term $term, $entityType ) { |
|
| 41 | 2 | $documents = $this->database |
|
| 42 | 2 | ->selectCollection( $entityType ) |
|
| 43 | 2 | ->find( |
|
| 44 | 2 | $this->buildGetEntityIdForTermQuery( $term ), |
|
|
|
|||
| 45 | 2 | [ '_id' => 1 ] |
|
| 46 | 2 | ); |
|
| 47 | |||
| 48 | 2 | $entities = []; |
|
| 49 | |||
| 50 | 2 | foreach( $documents as $document ) { |
|
| 51 | 2 | $entities[] = $this->documentBuilder->buildEntityIdForDocument( $document ); |
|
| 52 | 2 | } |
|
| 53 | |||
| 54 | 2 | return $entities; |
|
| 55 | } |
||
| 56 | |||
| 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: