Skip to content

Commit 6874ca6

Browse files
committed
Merge branch '6.1' into 6.2
* 6.1: [String] Add tests for AsciiSlugger [Serializer] Fix get accessor regex in AnnotationLoader [HttpKernel] Fix passing `null` to `\trim()` method in LoggerDataCollector Remove wrong PHPDoc [Translation] Crowdin provider throw Exception when status is 50x Always attempt to listen for notifications add missing changelog entry for the AtLeastOneOf constraint validate nested constraints only if they are in the same group
2 parents bd92a7e + aba2ebf commit 6874ca6

File tree

6 files changed

+19
-2
lines changed

6 files changed

+19
-2
lines changed

Mapping/Loader/AnnotationLoader.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ public function loadClassMetadata(ClassMetadataInterface $classMetadata): bool
100100
continue;
101101
}
102102

103-
$getAccessor = preg_match('/^(get|)(.+)$/i', $method->name);
104-
if ($getAccessor && 0 !== $method->getNumberOfRequiredParameters()) {
103+
if (0 === stripos($method->name, 'get') && $method->getNumberOfRequiredParameters()) {
105104
continue; /* matches the BC behavior in `Symfony\Component\Serializer\Normalizer\ObjectNormalizer::extractAttributes` */
106105
}
107106

Tests/Fixtures/Annotations/IgnoreDummyAdditionalGetter.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@ public function getExtraValue(string $parameter)
2020
{
2121
return $parameter;
2222
}
23+
24+
public function setExtraValue2(string $parameter)
25+
{
26+
}
2327
}

Tests/Fixtures/Annotations/IgnoreDummyAdditionalGetterWithoutIgnoreAnnotations.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,8 @@ public function getExtraValue(string $parameter)
1515
{
1616
return $parameter;
1717
}
18+
19+
public function setExtraValue2(string $parameter)
20+
{
21+
}
1822
}

Tests/Fixtures/Attributes/IgnoreDummyAdditionalGetter.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@ public function getExtraValue(string $parameter)
1818
{
1919
return $parameter;
2020
}
21+
22+
public function setExtraValue2(string $parameter)
23+
{
24+
}
2125
}

Tests/Fixtures/Attributes/IgnoreDummyAdditionalGetterWithoutIgnoreAnnotations.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,8 @@ public function getExtraValue(string $parameter)
1515
{
1616
return $parameter;
1717
}
18+
19+
public function setExtraValue2(string $parameter)
20+
{
21+
}
1822
}

Tests/Mapping/Loader/AnnotationLoaderTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ public function testIgnoreGetterWirhRequiredParameterIfIgnoreAnnotationIsUsed()
159159

160160
$attributes = $classMetadata->getAttributesMetadata();
161161
self::assertArrayNotHasKey('extraValue', $attributes);
162+
self::assertArrayHasKey('extraValue2', $attributes);
162163
}
163164

164165
public function testIgnoreGetterWirhRequiredParameterIfIgnoreAnnotationIsNotUsed()
@@ -168,6 +169,7 @@ public function testIgnoreGetterWirhRequiredParameterIfIgnoreAnnotationIsNotUsed
168169

169170
$attributes = $classMetadata->getAttributesMetadata();
170171
self::assertArrayNotHasKey('extraValue', $attributes);
172+
self::assertArrayHasKey('extraValue2', $attributes);
171173
}
172174

173175
abstract protected function createLoader(): AnnotationLoader;

0 commit comments

Comments
 (0)