| Total Complexity | 8 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class ComplexItemComponent implements \Vaimo\ComposerPatches\Interfaces\DefinitionExploderComponentInterface |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var \Vaimo\ComposerPatches\Patch\Definition\Exploder\ItemBuilder |
||
| 14 | */ |
||
| 15 | private $itemBuilder; |
||
| 16 | |||
| 17 | public function __construct() |
||
| 18 | { |
||
| 19 | $this->itemBuilder = new \Vaimo\ComposerPatches\Patch\Definition\Exploder\ItemBuilder(); |
||
| 20 | } |
||
| 21 | |||
| 22 | public function shouldProcess($label, $data) |
||
| 23 | { |
||
| 24 | if (!is_array($data)) { |
||
| 25 | return false; |
||
| 26 | } |
||
| 27 | |||
| 28 | $key = key($data); |
||
| 29 | $value = reset($data); |
||
| 30 | |||
| 31 | $versionKeySet = false; |
||
| 32 | |||
| 33 | if (is_array($value)) { |
||
| 34 | $versionKeySet = isset($value[PatchDefinition::VERSION]) |
||
| 35 | || isset($value[PatchDefinition::DEPENDS]); |
||
| 36 | } |
||
| 37 | |||
| 38 | return !is_numeric($key) && is_array($value) && $versionKeySet; |
||
| 39 | } |
||
| 40 | |||
| 41 | public function explode($label, $data) |
||
| 44 | } |
||
| 45 | } |
||
| 46 |