You are here

public function AnnotationDirectoryLoader::supports in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/routing/Loader/AnnotationDirectoryLoader.php \Symfony\Component\Routing\Loader\AnnotationDirectoryLoader::supports()

Overrides AnnotationFileLoader::supports

File

vendor/symfony/routing/Loader/AnnotationDirectoryLoader.php, line 67

Class

AnnotationDirectoryLoader
AnnotationDirectoryLoader loads routing information from annotations set on PHP classes and methods.

Namespace

Symfony\Component\Routing\Loader

Code

public function supports($resource, $type = null) {
  try {
    $path = $this->locator
      ->locate($resource);
  } catch (\Exception $e) {
    return false;
  }
  return is_string($resource) && is_dir($path) && (!$type || 'annotation' === $type);
}