Skip to content

Commit 7fe84ca

Browse files
committed
Refactored NamespaceBuilder
1 parent 086fb78 commit 7fe84ca

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/TransferGenerator/Definition/Parser/Expander/Builder/NamespaceBuilder.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function createNamespaceTransfer(string $namespace): DefinitionNamespaceT
2626

2727
private function getAlias(string $namespace): ?string
2828
{
29-
if (!str_contains($namespace, self::NAMESPACE_ALIAS_SEPARATOR)) {
29+
if (!$this->isNamespaceAlias($namespace)) {
3030
return null;
3131
}
3232

@@ -48,7 +48,7 @@ private function getBaseName(string $withoutAlias): string
4848

4949
private function getWithoutAlias(string $namespace): string
5050
{
51-
if (!str_contains($namespace, self::NAMESPACE_ALIAS_SEPARATOR)) {
51+
if (!$this->isNamespaceAlias($namespace)) {
5252
return $namespace;
5353
}
5454

@@ -71,4 +71,9 @@ private function filterNamespace(string $namespace): string
7171

7272
return $namespace;
7373
}
74+
75+
private function isNamespaceAlias(string $namespace): bool
76+
{
77+
return str_contains($namespace, self::NAMESPACE_ALIAS_SEPARATOR);
78+
}
7479
}

0 commit comments

Comments
 (0)