| Total Complexity | 9 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class DefinitionList implements IteratorAggregate |
||
| 14 | { |
||
| 15 | use KeyValueList { |
||
| 16 | set as private; |
||
| 17 | } |
||
| 18 | |||
| 19 | public function add(Definition $definition) |
||
| 22 | } |
||
| 23 | |||
| 24 | public function hasTag(string $tag): bool |
||
| 25 | { |
||
| 26 | foreach ($this->elements as $definition) { |
||
| 27 | if ($definition instanceof Taggable && $definition->hasTag($tag)) { |
||
| 28 | return true; |
||
| 29 | } |
||
| 30 | } |
||
| 31 | |||
| 32 | return false; |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @param string $tag |
||
| 37 | * @return Definition[]|Taggable[] |
||
| 38 | */ |
||
| 39 | public function getTagged(string $tag): array |
||
| 49 | } |
||
| 50 | } |
||
| 51 |