for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace DependencyAnalyzer\DependencyGraph\FullyQualifiedStructuralElementName;
use DependencyAnalyzer\DependencyGraph\FullyQualifiedStructuralElementName;
class Namespace_ extends Base
{
public function getType(): string
return FullyQualifiedStructuralElementName::TYPE_NAMESPACE;
}
public function include(Base $that): bool
if ($this->toString() === '\\') {
// Pattern likely '\\' will match with all className.
return true;
} elseif ($this->isSame($that)) {
} elseif (count($this->getFullyQualifiedNamespaceName()) > count($this->getFullyQualifiedNamespaceName())) {
return false;
$namesOfThat = $that->getFullyQualifiedNamespaceName();
foreach ($this->getFullyQualifiedNamespaceName() as $index => $name) {
if (!isset($namesOfThat[$index]) || $namesOfThat[$index] !== $name) {
public function isNamespace(): bool
public function getFullyQualifiedNamespaceName(): array
return [];
return explode('\\', trim($this->toString(), '\\'));
public function getFullyQualifiedClassName(): ?array
return null;