| Total Complexity | 7 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 10 | class StorefrontPluginConfigurationCollection extends Collection |
||
| 11 | { |
||
| 12 | public function __construct(iterable $elements = []) |
||
| 13 | { |
||
| 14 | parent::__construct([]); |
||
| 15 | |||
| 16 | foreach ($elements as $element) { |
||
| 17 | $this->validateType($element); |
||
| 18 | |||
| 19 | $this->set($element->getTechnicalName(), $element); |
||
| 20 | } |
||
| 21 | } |
||
| 22 | |||
| 23 | public function add($element): void |
||
| 24 | { |
||
| 25 | $this->validateType($element); |
||
| 26 | |||
| 27 | $this->set($element->getTechnicalName(), $element); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function getByTechnicalName(string $name): ?StorefrontPluginConfiguration |
||
| 35 | } |
||
| 36 | |||
| 37 | public function getThemes(): StorefrontPluginConfigurationCollection |
||
| 38 | { |
||
| 39 | return $this->filter(function (StorefrontPluginConfiguration $configuration) { |
||
| 40 | return $configuration->getIsTheme(); |
||
| 41 | }); |
||
| 42 | } |
||
| 43 | |||
| 44 | public function getNoneThemes(): StorefrontPluginConfigurationCollection |
||
| 48 | }); |
||
| 49 | } |
||
| 50 | |||
| 51 | protected function getExpectedClass(): ?string |
||
| 56 |