8000 minor #51607 [PropertyInfo] Remove checking if `AttributeMetadataInte… · symfony/symfony@0ac0229 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0ac0229

Browse files
committed
minor #51607 [PropertyInfo] Remove checking if AttributeMetadataInterface::setIgnore method exists (alamirault)
This PR was merged into the 6.4 branch. Discussion ---------- [PropertyInfo] Remove checking if `AttributeMetadataInterface::setIgnore` method exists | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> This PR remove checking if method `AttributeMetadataInterface::setIgnore` exists. This method was introduced in symfony 5.1 (https://github.com/symfony/symfony/pull/28744/files#diff-98f3aa4632c5366a34f92bfa1b2165742bf5b572da2fb4f888d8fe47465eb8eaR67), so with the following requirements, it's always available - PropertyInfo: conflict with `"symfony/serializer": "<5.4",` Commits ------- e2237cd [PropertyInfo] Remove checking if AttributeMetadataInterface setIgnore method exist
2 parents 9b2a4db + e2237cd commit 0ac0229

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/PropertyInfo/Extractor/SerializerExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function getProperties(string $class, array $context = []): ?array
4242
$serializerClassMetadata = $this->classMetadataFactory->getMetadataFor($class);
4343

4444
foreach ($serializerClassMetadata->getAttributesMetadata() as $serializerAttributeMetadata) {
45-
$ignored = method_exists($serializerAttributeMetadata, 'isIgnored') && $serializerAttributeMetadata->isIgnored();
45+
$ignored = $serializerAttributeMetadata->isIgnored();
4646
if (!$ignored && (null === $context['serializer_groups'] || array_intersect($context['serializer_groups'], $serializerAttributeMetadata->getGroups()))) {
4747
$properties[] = $serializerAttributeMetadata->getName();
4848
}

0 commit comments

Comments
 (0)
0