Skip to content

Commit aba2ebf

Browse files
committed
Merge branch '6.0' into 6.1
* 6.0: [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 942d012 + a269927 commit aba2ebf

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
@@ -154,6 +154,7 @@ public function testIgnoreGetterWirhRequiredParameterIfIgnoreAnnotationIsUsed()
154154

155155
$attributes = $classMetadata->getAttributesMetadata();
156156
self::assertArrayNotHasKey('extraValue', $attributes);
157+
self::assertArrayHasKey('extraValue2', $attributes);
157158
}
158159

159160
public function testIgnoreGetterWirhRequiredParameterIfIgnoreAnnotationIsNotUsed()
@@ -163,6 +164,7 @@ public function testIgnoreGetterWirhRequiredParameterIfIgnoreAnnotationIsNotUsed
163164

164165
$attributes = $classMetadata->getAttributesMetadata();
165166
self::assertArrayNotHasKey('extraValue', $attributes);
167+
self::assertArrayHasKey('extraValue2', $attributes);
166168
}
167169

168170
abstract protected function createLoader(): AnnotationLoader;

0 commit comments

Comments
 (0)