Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
24 | public function check(ThemeInterface $theme, array $previousThemes = []) |
||
25 | { |
||
26 | if (0 === count($theme->getParents())) { |
||
27 | return; |
||
28 | } |
||
29 | |||
30 | $previousThemes = array_merge($previousThemes, [$theme]); |
||
31 | foreach ($theme->getParents() as $parent) { |
||
32 | if (in_array($parent, $previousThemes, true)) { |
||
33 | throw new CircularDependencyFoundException(array_merge($previousThemes, [$parent])); |
||
34 | } |
||
35 | |||
36 | $this->check($parent, $previousThemes); |
||
37 | } |
||
38 | } |
||
39 | } |
||
40 |