Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
48 | 17 | protected function escapeValues(array $values, Escaper $escaper): array |
|
49 | { |
||
50 | 17 | $escapedValues = []; |
|
51 | |||
52 | 17 | foreach($values as $value) |
|
53 | { |
||
54 | 17 | $formatedValue = $this->type->format($value); |
|
55 | 17 | if($this->type->isEscapeRequired()) |
|
56 | { |
||
57 | 13 | $formatedValue = $escaper->escape($formatedValue); |
|
58 | } |
||
59 | |||
60 | 17 | $escapedValues[] = $formatedValue; |
|
61 | } |
||
62 | |||
63 | 17 | return $escapedValues; |
|
64 | } |
||
65 | } |
||
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.