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