Conditions | 7 |
Paths | 6 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function include(Base $that): bool |
||
16 | { |
||
17 | if ($this->toString() === '\\') { |
||
18 | // Pattern likely '\\' will match with all className. |
||
19 | return true; |
||
20 | } elseif ($this->isSame($that)) { |
||
21 | return true; |
||
22 | } elseif (count($this->getFullyQualifiedNamespaceName()) > count($this->getFullyQualifiedNamespaceName())) { |
||
23 | return false; |
||
24 | } |
||
25 | |||
26 | $namesOfThat = $that->getFullyQualifiedNamespaceName(); |
||
27 | foreach ($this->getFullyQualifiedNamespaceName() as $index => $name) { |
||
28 | if (!isset($namesOfThat[$index]) || $namesOfThat[$index] !== $name) { |
||
29 | return false; |
||
30 | } |
||
31 | } |
||
32 | |||
33 | return true; |
||
34 | } |
||
55 |