| Conditions | 3 |
| Paths | 3 |
| Total Lines | 9 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 57 | public function write(Buffer $buffer) |
||
| 58 | { |
||
| 59 | if ($this->data) { |
||
|
|
|||
| 60 | $this->dataCount = count($this->data) * 3; |
||
| 61 | parent::write($buffer); |
||
| 62 | foreach ($this->data as $item) { |
||
| 63 | $buffer->writeInt(0xFF & $item[0]); |
||
| 64 | $buffer->writeInt(0xFF & $item[1]); |
||
| 65 | $buffer->writeInt(0xFF & $item[2]); |
||
| 66 | } |
||
| 70 |
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.