| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | 2 | public function prepareStatement($SQL, $parameters = []) |
|
| 46 | { |
||
| 47 | 2 | $stmt = $this->wrappedConnection->prepare($SQL); |
|
| 48 | 2 | $wrappedStatement = new PDOStatement($stmt); |
|
| 49 | |||
| 50 | 2 | if ($parameters) { |
|
|
|
|||
| 51 | 1 | $wrappedStatement->bindParameters($parameters); |
|
| 52 | 1 | } |
|
| 53 | |||
| 54 | 2 | return $wrappedStatement; |
|
| 55 | } |
||
| 56 | } |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.