Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 763ef35

Browse files
kriswallsmithfabpot
authored andcommitted
[Routing] added creation of a file resource in annotations loader
1 parent 32aef96 commit 763ef35

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
namespace Symfony\Component\Routing\Loader;
44

5-
use Symfony\Component\Routing\RouteCollection;
6-
use Symfony\Component\Routing\Route;
75
use Doctrine\Common\Annotations\AnnotationReader;
86
use Symfony\Component\Routing\Annotation\Route as RouteAnnotation;
97
use Symfony\Component\Routing\Loader\LoaderResolver;
8+
use Symfony\Component\Routing\Resource\FileResource;
9+
use Symfony\Component\Routing\Route;
10+
use Symfony\Component\Routing\RouteCollection;
1011

1112
/*
1213
* This file is part of the Symfony framework.
@@ -121,6 +122,7 @@ public function load($class, $type = null)
121122
}
122123

123124
$collection = new RouteCollection();
125+
$collection->addResource(new FileResource($class->getFileName()));
124126
foreach ($class->getMethods() as $method) {
125127
if ($annot = $this->reader->getMethodAnnotation($method, $this->annotationClass)) {
126128
if (null === $annot->getName()) {

0 commit comments

Comments
 (0)