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

[HttpKernel] Fix datacollector caster for reference object property#54072

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

Conversation

@ebuildy
Copy link
Contributor

@ebuildyebuildy commentedFeb 26, 2024
edited
Loading

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?no
IssuesFix#49091
LicenseMIT

As discussed on#49091:

Unit tests FAIL "Error: KO src/Symfony/Component/HttpKernel" --> normal

katapofatico reacted with hooray emoji
@ebuildyebuildy marked this pull request as ready for reviewFebruary 26, 2024 22:43
@carsonbotcarsonbot added this to the5.4 milestoneFeb 26, 2024
@OskarStarkOskarStark changed the title[HttpKernel] fix datacollector caster for reference object property[HttpKernel] Fix datacollector caster for reference object propertyFeb 29, 2024
@symfonysymfony deleted a comment fromcarsonbotFeb 29, 2024
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nice, thanks for the test cases.
Here is the correct patch that fixes both aspect of the issue:

--- a/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php+++ b/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php@@ -70,16 +70,21 @@ abstract class DataCollector implements DataCollectorInterface         $casters = [             '*' => function ($v, array $a, Stub $s, $isNested) {                 if (!$v instanceof Stub) {+                    $b = $a;                     foreach ($a as $k => $v) {                         if (!\is_object($v) || $v instanceof \DateTimeInterface || $v instanceof Stub) {                             continue;                         }                          try {-                            $a[$k] = new CutStub($v);+                            $a[$k] = $s = new CutStub($v);++                            if ($b[$k] === $s) {+                                // we've hit a non-typed reference+                                $a[$k] = $v;+                            }                         } catch (\TypeError $e) {-                            $a[$k] = &$v;-                            unset($v);+                            // we've hit a typed reference                         }                     }                 }

@nicolas-grekas
Copy link
Member

Can you please make the necessary changes to fix the CI on PHP 7.2+? (that could involve using@requires PHP 8.0 on test cases of course)

ebuildy reacted with hooray emojiebuildy reacted with eyes emoji

@nicolas-grekasnicolas-grekasforce-pushed thefix_httpkernel_clone_caster branch fromb2a9d7d to457a3deCompareApril 12, 2024 11:55
@nicolas-grekas
Copy link
Member

Thank you@ebuildy.

ebuildy reacted with hooray emoji

@nicolas-grekasnicolas-grekas merged commit8004c14 intosymfony:5.4Apr 12, 2024
@ebuildyebuildy deleted the fix_httpkernel_clone_caster branchApril 12, 2024 13:18
xabbuh added a commit that referenced this pull requestApr 12, 2024
This PR was merged into the 5.4 branch.Discussion----------[HttpKernel] fix low deps tests| Q             | A| ------------- | ---| Branch?       | 5.4| Bug fix?      | no| New feature?  | no| Deprecations? | no| Issues        || License       | MITafter#54072 we need#43171Commits-------c78255d fix low deps tests
This was referencedApr 29, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

3 participants

@ebuildy@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp