[Routing] added creation of a file resource in annotations loader
This commit is contained in:
parent
32aef96441
commit
763ef35d0e
@ -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()) {
|
||||
|
Reference in New Issue
Block a user