Conditions | 3 |
Paths | 2 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
29 | 4 | public function build(ExpressionInterface $expression, array &$params = []) |
|
30 | { |
||
31 | 4 | $orderBy = $expression->query->orderBy; |
|
|
|||
32 | |||
33 | 4 | if ($orderBy[0] === $expression && count($orderBy) === 1) { |
|
34 | |||
35 | 4 | return $this->queryBuilder->buildExpression($expression->getExpression()); |
|
36 | } else { // user choice |
||
37 | |||
38 | 1 | return '(SELECT NULL)'; |
|
39 | } |
||
40 | } |
||
41 | } |
||
42 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: