Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fixing typo in variable name#16087

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
yceruto wants to merge1 commit intosymfony:2.8fromyceruto:patch-1
Closed

Fixing typo in variable name#16087

yceruto wants to merge1 commit intosymfony:2.8fromyceruto:patch-1

Conversation

@yceruto
Copy link
Member

@ycerutoyceruto commentedOct 2, 2015
edited
Loading

QA
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsnone
foreach ($reflectionClass->getProperties()as$property) {if (!isset($attributeMetadata[$property->name])) {// <--- looks here$attributesMetadata[$property->name] =newAttributeMetadata($property->name);$classMetadata->addAttributeMetadata($attributesMetadata[$property->name]);    }if ($property->getDeclaringClass()->name ===$className) {foreach ($this->reader->getPropertyAnnotations($property)as$groups) {if ($groupsinstanceof Groups) {foreach ($groups->getGroups()as$group) {$attributesMetadata[$property->name]->addGroup($group);                }            }$loaded =true;        }    }}

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

This condition is always `true` because `$attributesMetadata` does not exists in this `foreach` context and could overwrite values in the `$attributesMetadata` variable.
@stof
Copy link
Member

stof commentedOct 2, 2015

👍

@Tobion
Copy link
Contributor

👍 But should be merged in 2.7

@fabpot
Copy link
Member

Thank you@yceruto.

@fabpotfabpot closed thisOct 3, 2015
fabpot added a commit that referenced this pull requestOct 3, 2015
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```phpforeach ($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 | noneCommits-------89499ff Fixing typo in variable name
@fabpotfabpot mentioned this pull requestOct 27, 2015
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@yceruto@stof@Tobion@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp