Skip to content

Commit d677755

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: [Tests] Remove some unused fixtures added missing translations for portuguese [#43726] [HttpClient][Mime] Add correct IDN flags for IDNA2008 compliance Prevent installation of incompatible mailer component versions properly parse quoted strings tagged with !!str do not merge label classes into expanded choice labels Bump Symfony version to 5.4.0 Update VERSION for 5.4.0-BETA3 Update CHANGELOG for 5.4.0-BETA3 [Serializer] PropertyNormalizer - return unique (i.e. filter duplicate ) attributes in extractAttributes function Allow autodetecting mapping type for any object
2 parents a912c52 + ff3657d commit d677755

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

DependencyInjection/AbstractDoctrineExtension.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,15 @@ private function detectMappingType(string $directory, ContainerBuilder $containe
286286
$glob = new GlobResource($directory, '*', true);
287287
$container->addResource($glob);
288288

289+
$quotedMappingObjectName = preg_quote($this->getMappingObjectDefaultName(), '/');
290+
289291
foreach ($glob as $file) {
290292
$content = file_get_contents($file);
291293

292-
if (preg_match('/^#\[.*Entity\b/m', $content)) {
294+
if (preg_match('/^#\[.*'.$quotedMappingObjectName.'\b/m', $content)) {
293295
break;
294296
}
295-
if (preg_match('/^ \* @.*Entity\b/m', $content)) {
297+
if (preg_match('/^ \* @.*'.$quotedMappingObjectName.'\b/m', $content)) {
296298
$type = 'annotation';
297299
break;
298300
}

Tests/DependencyInjection/DoctrineExtensionTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ protected function setUp(): void
4949
->willReturnCallback(function ($name) {
5050
return 'doctrine.orm.'.$name;
5151
});
52+
53+
$this->extension
54+
->method('getMappingObjectDefaultName')
55+
->willReturn('Entity');
5256
}
5357

5458
public function testFixManagersAutoMappingsWithTwoAutomappings()

0 commit comments

Comments
 (0)