Conditions | 5 |
Paths | 6 |
Total Lines | 20 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | 1 | public function srcsetMap(): array |
|
11 | { |
||
12 | 1 | $map = []; |
|
13 | |||
14 | 1 | if (is_array($this->original) && |
|
15 | 1 | !empty($this->original['srcset'])) { |
|
16 | 1 | $map[''] = $this->original['srcset']; |
|
17 | } |
||
18 | |||
19 | 1 | foreach ($this->formats as $format => $configuration) { |
|
20 | 1 | if (!empty($configuration['srcset'])) { |
|
21 | 1 | $map[$format] = $configuration['srcset']; |
|
22 | } |
||
23 | } |
||
24 | |||
25 | 1 | uasort($map, function ($a, $b) { |
|
26 | 1 | return (int)$b - (int)$a; |
|
27 | 1 | }); |
|
28 | |||
29 | 1 | return $map; |
|
30 | } |
||
32 |