Total Complexity | 9 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Coverage | 95% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
11 | trait HasConversionsTrait |
||
12 | { |
||
13 | protected $conversions = null; |
||
14 | |||
15 | protected $conversionNames; |
||
16 | |||
17 | 3 | public function getConversionNames(): array |
|
18 | { |
||
19 | 3 | if ($this->conversionNames == null) { |
|
20 | 3 | $this->conversionNames = $this->generateConversionNames(); |
|
21 | } |
||
22 | 3 | return $this->conversionNames; |
|
23 | } |
||
24 | |||
25 | /** |
||
26 | * @return array |
||
27 | */ |
||
28 | 3 | protected function generateConversionNames() |
|
29 | { |
||
30 | 3 | $conversions = $this->getConversions(); |
|
31 | |||
32 | 3 | $return = []; |
|
33 | 3 | foreach ($conversions as $conversion) { |
|
34 | 1 | $return[] = $conversion->getName(); |
|
35 | } |
||
36 | 3 | return $return; |
|
37 | } |
||
38 | |||
39 | 3 | public function getConversions(): ConversionCollection |
|
45 | } |
||
46 | |||
47 | /** |
||
48 | * @return ConversionCollection |
||
49 | */ |
||
50 | 3 | protected function generateConversions() |
|
58 | } |
||
59 | |||
61 |