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

Fix PropertyAccessor modifying array in object when array key does no…#16090

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

Merged
fabpot merged 1 commit intosymfony:2.3frompierredup:property_access
Oct 5, 2015

Conversation

@pierredup
Copy link
Contributor

QA
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#16056
LicenseMIT
Doc PR

@Tobion
Copy link
Contributor

👍 Looks good. But applying this in 2.7 will be tricky because we cannot just skip the last item as we also support throwing aNoSuchIndexException inhttps://github.com/symfony/symfony/blob/2.8/src/Symfony/Component/PropertyAccess/PropertyAccessor.php#L234

@pierredup do you have an idea how to best solve it in 2.7?

@Tobion
Copy link
Contributor

I think the best is to just move the test within the outer if in 2.7

if ($i + 1 < $propertyPath->getLength()) {    $objectOrArray[$property] = array();}

And ensure we have a test covering this when usingthrowExceptionOnInvalidIndex = true

@pierredup
Copy link
ContributorAuthor

@Tobion I've just tested this on the 2.7 branch, and it works by wrapping the assignment in theif.
I've updated this PR to use that approach instead, to make the merging into 2.7 a bit easier.
When this is merged then I'll create more tests to check for theNoSuchIndexException

@fabpot
Copy link
Member

Thank you@pierredup.

@fabpotfabpot merged commitf24c678 intosymfony:2.3Oct 5, 2015
fabpot added a commit that referenced this pull requestOct 5, 2015
…key does no… (pierredup)This PR was merged into the 2.3 branch.Discussion----------Fix PropertyAccessor modifying array in object when array key does no…| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#16056| License       | MIT| Doc PR        |Commits-------f24c678 Fix PropertyAccessor modifying array in object when array key does not exist
fabpot added a commit that referenced this pull requestOct 7, 2015
This PR was merged into the 2.7 branch.Discussion----------Added more tests for PropertyAccess| Q             | A| ------------- | ---| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |This is a follow up for [16090#issuecomment-145183635](#16090 (comment))Commits-------378db75 Added more tests for PropertyAccess
This was referencedOct 27, 2015
@pierreduppierredup deleted the property_access branchFebruary 16, 2017 19:51
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.

4 participants

@pierredup@Tobion@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp