Quellcode durchsuchen

[Routing] added creation of a file resource in annotations loader

Kris Wallsmith vor 14 Jahren
Ursprung
Commit
763ef35d0e
1 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen
  1. 4 2
      src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php

+ 4 - 2
src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php

@@ -2,11 +2,12 @@
 
 namespace Symfony\Component\Routing\Loader;
 
-use Symfony\Component\Routing\RouteCollection;
-use Symfony\Component\Routing\Route;
 use Doctrine\Common\Annotations\AnnotationReader;
 use Symfony\Component\Routing\Annotation\Route as RouteAnnotation;
 use Symfony\Component\Routing\Loader\LoaderResolver;
+use Symfony\Component\Routing\Resource\FileResource;
+use Symfony\Component\Routing\Route;
+use Symfony\Component\Routing\RouteCollection;
 
 /*
  * This file is part of the Symfony framework.
@@ -121,6 +122,7 @@ abstract class AnnotationClassLoader implements LoaderInterface
         }
 
         $collection = new RouteCollection();
+        $collection->addResource(new FileResource($class->getFileName()));
         foreach ($class->getMethods() as $method) {
             if ($annot = $this->reader->getMethodAnnotation($method, $this->annotationClass)) {
                 if (null === $annot->getName()) {