| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function handle(Query $query) |
||
| 40 | { |
||
| 41 | if (!($query instanceof SpecificationQuery)) { |
||
| 42 | return null; |
||
| 43 | } |
||
| 44 | |||
| 45 | /* @var $rep EntitySpecificationRepositoryInterface */ |
||
| 46 | $rep = $this->em->getRepository($query->getEntity()); |
||
| 47 | |||
| 48 | return $rep->match($query->getSpec(), $query->getModifier()); |
||
|
|
|||
| 49 | } |
||
| 50 | } |
||
| 51 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: