| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 19 | public function toString(Escaper $escaper): string |
|
| 23 | { |
||
| 24 | 19 | if($this->isEmpty()) |
|
| 25 | { |
||
| 26 | 2 | return ''; |
|
| 27 | } |
||
| 28 | |||
| 29 | 17 | $values = $this->escapeValues($this->values, $escaper); |
|
| 30 | |||
| 31 | 17 | return sprintf( |
|
| 32 | 17 | '%s %s (%s)', |
|
| 33 | 17 | $this->type->getName(), |
|
| 34 | 17 | $this->getOperator(), |
|
| 35 | 17 | implode(', ', $values) |
|
| 36 | ); |
||
| 37 | } |
||
| 38 | |||
| 66 |
Only declaring a single property per statement allows you to later on add doc comments more easily.
It is also recommended by PSR2, so it is a common style that many people expect.