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 11
11
12
12
namespace Symfony \Bundle \MakerBundle \Util ;
13
13
14
- use ReflectionClass ;
15
- use ReflectionException ;
16
-
17
14
/**
18
15
* @author Jesse Rushlow <[email protected] >
19
16
*
@@ -48,11 +45,11 @@ public function getPropertyType(ClassNameDetails $classNameDetails): ?string
48
45
}
49
46
50
47
/**
51
- * @throws ReflectionException
48
+ * @throws \ ReflectionException
52
49
*/
53
50
public function repositoryHasSaveAndRemoveMethods (string $ repositoryFullClassName ): bool
54
51
{
55
- $ reflectedComponents = new ReflectionClass ($ repositoryFullClassName );
52
+ $ reflectedComponents = new \ ReflectionClass ($ repositoryFullClassName );
56
53
57
54
return $ reflectedComponents ->hasMethod ('save ' ) && $ reflectedComponents ->hasMethod ('remove ' );
58
55
}
Original file line number Diff line number Diff line change 12
12
namespace Symfony \Bundle \MakerBundle \Tests \Maker ;
13
13
14
14
use PHPUnit \Framework \TestCase ;
15
- use ReflectionClass ;
16
15
use Symfony \Bundle \FrameworkBundle \Console \Application ;
17
16
use Symfony \Bundle \MakerBundle \Command \MakerCommand ;
18
17
use Symfony \Bundle \MakerBundle \Test \MakerTestKernel ;
@@ -38,7 +37,7 @@ public function testWiring()
38
37
39
38
$ application = new Application ($ kernel );
40
39
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 ' )));
42
41
43
42
if ($ maker ->isAbstract ()) {
44
43
continue ;
Original file line number Diff line number Diff line change @@ -122,6 +122,20 @@ public function getTestDetails(): \Generator
122
122
Yaml::dump (['maker ' => ['root_namespace ' => 'Custom ' ]])
123
123
);
124
124
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
+
125
139
$ runner ->copy (
126
140
'make-crud/SweetFood-custom-namespace.php ' ,
127
141
'src/Entity/SweetFood.php '
You can’t perform that action at this time.
0 commit comments