File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -30,20 +30,10 @@ private function createMakeEntityTest(bool $withDatabase = true): MakerTestDetai
30
30
{
31
31
return $ this ->createMakerTest ()
32
32
->preRun (function (MakerTestRunner $ runner ) use ($ withDatabase ) {
33
- $ config = $ runner ->readYaml ('config/packages/doctrine.yaml ' );
34
- $ appMapping = $ config ['doctrine ' ]['orm ' ]['mappings ' ]['App ' ] ?? [];
35
-
36
33
/* @legacy Refactor when annotations are no longer supported. */
37
- if (isset ($ appMapping ['type ' ]) && $ this ->useAttributes ($ runner )) {
38
- // We want to use attributes by default in tests if they're supported.
39
- $ runner ->replaceInFile (
40
- 'config/packages/doctrine.yaml ' ,
41
- 'type: annotation ' ,
42
- 'type: attribute '
43
- );
44
- } elseif (!empty ($ appMapping ) && !$ this ->useAttributes ($ runner )) {
45
- // Flex assumes attributes are supported based on package versions.
46
- // When PHP <8.0, we have to use annotations.
34
+ if (!$ this ->useAttributes ($ runner )) {
35
+ // Attributes are only supported w/ PHP 8, FrameworkBundle >=5.2,
36
+ // ORM >=2.9, & DoctrineBundle >=2.4
47
37
$ runner ->modifyYamlFile ('config/packages/doctrine.yaml ' , function (array $ data ) {
48
38
$ data ['doctrine ' ]['orm ' ]['mappings ' ]['App ' ]['type ' ] = 'annotation ' ;
49
39
You can’t perform that action at this time.
0 commit comments