| Total Complexity | 8 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 10 | final class UseStatement |
||
| 11 | { |
||
| 12 | 39 | public function __construct(private Name $name, private ?Name $alias) |
|
| 13 | { |
||
| 14 | 39 | } |
|
| 15 | |||
| 16 | 28 | public function endsWith(Name $name): bool |
|
| 17 | { |
||
| 18 | 28 | return str_ends_with(haystack: (string) $this->name, needle: $name->removeArraySuffix()); |
|
| 19 | } |
||
| 20 | |||
| 21 | 21 | public function includes(Name $name): bool |
|
| 22 | { |
||
| 23 | 21 | return str_ends_with(haystack: (string) $this->name, needle: $name->first()); |
|
| 24 | } |
||
| 25 | |||
| 26 | 21 | public function isAliasedAs(Name $name): bool |
|
| 29 | } |
||
| 30 | |||
| 31 | 25 | public function fullyQualifiedName(Name $name): string |
|
| 32 | { |
||
| 33 | 25 | return $name->isArray() ? "{$this->name->fullName()}[]" : $this->name->fullName(); |
|
| 34 | } |
||
| 35 | |||
| 36 | 2 | public function merge(Name $name): string |
|
| 39 | } |
||
| 40 | } |
||
| 41 |