. */ namespace Irstea\PlantUmlBundle\Model\Filter; use ReflectionClass; /** * Description of DirectoryFilter. */ class NamespaceFilter extends AbstractListFilter { public const CONF_TYPE = 'namespaces'; /** * {@inheritdoc} */ protected function extract(ReflectionClass $class): string { return $class->getNamespaceName(); } /** * {@inheritdoc} */ protected function matches($tested, $reference): bool { return strpos($tested, $reference) === 0; } /** * {@inheritdoc} */ protected function normalize($namespace): string { return trim($namespace, '\\') . '\\'; } }