File tree Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 1111
1212namespace Symfony \Bundle \MakerBundle \Util ;
1313
14- use ReflectionClass ;
15- use ReflectionException ;
16-
1714/**
1815 * @author Jesse Rushlow <[email protected] > 1916 *
@@ -48,11 +45,11 @@ public function getPropertyType(ClassNameDetails $classNameDetails): ?string
4845 }
4946
5047 /**
51- * @throws ReflectionException
48+ * @throws \ ReflectionException
5249 */
5350 public function repositoryHasSaveAndRemoveMethods (string $ repositoryFullClassName ): bool
5451 {
55- $ reflectedComponents = new ReflectionClass ($ repositoryFullClassName );
52+ $ reflectedComponents = new \ ReflectionClass ($ repositoryFullClassName );
5653
5754 return $ reflectedComponents ->hasMethod ('save ' ) && $ reflectedComponents ->hasMethod ('remove ' );
5855 }
Original file line number Diff line number Diff line change 1212namespace Symfony \Bundle \MakerBundle \Tests \Maker ;
1313
1414use PHPUnit \Framework \TestCase ;
15- use ReflectionClass ;
1615use Symfony \Bundle \FrameworkBundle \Console \Application ;
1716use Symfony \Bundle \MakerBundle \Command \MakerCommand ;
1817use Symfony \Bundle \MakerBundle \Test \MakerTestKernel ;
@@ -38,7 +37,7 @@ public function testWiring()
3837
3938 $ application = new Application ($ kernel );
4039 foreach ($ finder as $ file ) {
41- $ maker = new ReflectionClass (sprintf ('Symfony\Bundle\MakerBundle\Maker\%s ' , $ file ->getBasename ('.php ' )));
40+ $ maker = new \ ReflectionClass (sprintf ('Symfony\Bundle\MakerBundle\Maker\%s ' , $ file ->getBasename ('.php ' )));
4241
4342 if ($ maker ->isAbstract ()) {
4443 continue ;
Original file line number Diff line number Diff line change @@ -122,6 +122,20 @@ public function getTestDetails(): \Generator
122122 Yaml::dump (['maker ' => ['root_namespace ' => 'Custom ' ]])
123123 );
124124
125+ // @legacy Conditional can be removed when Symfony 5.4 support is dropped
126+ if (60000 <= $ runner ->getSymfonyVersion ()) {
127+ // Symfony 6.2 sets the path and namespace for router resources
128+ $ runner ->modifyYamlFile ('config/routes.yaml ' , function (array $ config ) {
129+ if (!isset ($ config ['controllers ' ]['resource ' ]['namespace ' ])) {
130+ return $ config ;
131+ }
132+
133+ $ config ['controllers ' ]['resource ' ]['namespace ' ] = 'Custom\Controller ' ;
134+
135+ return $ config ;
136+ });
137+ }
138+
125139 $ runner ->copy (
126140 'make-crud/SweetFood-custom-namespace.php ' ,
127141 'src/Entity/SweetFood.php '
You can’t perform that action at this time.
0 commit comments