bug #16087 Fixing typo in variable name (yceruto)

This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes #16087).

Discussion
----------

Fixing typo in variable name

```php
foreach ($reflectionClass->getProperties() as $property) {
    if (!isset($attributeMetadata[$property->name])) {
        $attributesMetadata[$property->name] = new AttributeMetadata($property->name);
        $classMetadata->addAttributeMetadata($attributesMetadata[$property->name]);
    }

    if ($property->getDeclaringClass()->name === $className) {
        foreach ($this->reader->getPropertyAnnotations($property) as $groups) {
            if ($groups instanceof Groups) {
                foreach ($groups->getGroups() as $group) {
                    $attributesMetadata[$property->name]->addGroup($group);
                }
            }

            $loaded = true;
        }
    }
}
```

This `$attributeMetadata` does not exists in this `foreach` context and the goal of this condition could be unexpected.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none

Commits
-------

89499ff Fixing typo in variable name
This commit is contained in:
Fabien Potencier 2015-10-03 08:19:38 +02:00
commit 2e386b3ca1

View File

@ -49,7 +49,7 @@ class AnnotationLoader implements LoaderInterface
$attributesMetadata = $classMetadata->getAttributesMetadata();
foreach ($reflectionClass->getProperties() as $property) {
if (!isset($attributeMetadata[$property->name])) {
if (!isset($attributesMetadata[$property->name])) {
$attributesMetadata[$property->name] = new AttributeMetadata($property->name);
$classMetadata->addAttributeMetadata($attributesMetadata[$property->name]);
}