minor #22427 [PropertyInfo] Remove a useless call to count() in SerializerExtractor (dunglas)

This PR was merged into the 2.8 branch.

Discussion
----------

[PropertyInfo] Remove a useless call to count() in SerializerExtractor

| Q             | A
| ------------- | ---
| Branch?       |  2.8 <!-- see comment below -->
| Bug fix?      | no
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

7a8a72ddbf [PropertyInfo] Remove a useless call to count() in SerializerExtractor
This commit is contained in:
Fabien Potencier 2017-04-13 13:03:47 -07:00
commit f5609e809c

View File

@ -48,7 +48,7 @@ class SerializerExtractor implements PropertyListExtractorInterface
$serializerClassMetadata = $this->classMetadataFactory->getMetadataFor($class);
foreach ($serializerClassMetadata->getAttributesMetadata() as $serializerAttributeMetadata) {
if (count(array_intersect($context['serializer_groups'], $serializerAttributeMetadata->getGroups())) > 0) {
if (array_intersect($context['serializer_groups'], $serializerAttributeMetadata->getGroups())) {
$properties[] = $serializerAttributeMetadata->getName();
}
}