public function AnnotationDirectoryLoader::supports

Overrides AnnotationFileLoader::supports

File

drupal/core/vendor/symfony/routing/Symfony/Component/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);
}