Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
42.86% |
3 / 7 |
|
75.00% |
3 / 4 |
CRAP | |
0.00% |
0 / 1 |
| Images | |
42.86% |
3 / 7 |
|
75.00% |
3 / 4 |
9.66 | |
0.00% |
0 / 1 |
| __toString | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
| current | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| get | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| first | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Cosray\Value; |
| 6 | |
| 7 | class Images extends Files |
| 8 | { |
| 9 | public function __toString(): string |
| 10 | { |
| 11 | $out = ''; |
| 12 | |
| 13 | for ($i = 0; $i < count($this->files()); $i++) { |
| 14 | $out .= (string) $this->get($i); |
| 15 | } |
| 16 | |
| 17 | return $out; |
| 18 | } |
| 19 | |
| 20 | public function current(): Image |
| 21 | { |
| 22 | return $this->get($this->pointer); |
| 23 | } |
| 24 | |
| 25 | public function get(int $index): Image |
| 26 | { |
| 27 | return new Image($this->owner, $this->field, $this->context, $index); |
| 28 | } |
| 29 | |
| 30 | public function first(): Image |
| 31 | { |
| 32 | return new Image($this->owner, $this->field, $this->context, 0); |
| 33 | } |
| 34 | } |