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

[TypeInfo] FixisSatisfiedBy not traversing type tree#59844

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:7.2frommtarld:fix/is-satisfied-by
Mar 24, 2025

Conversation

mtarld
Copy link
Contributor

QA
Branch?7.2
Bug fix?yes
New feature?no
Deprecations?no
Issues
LicenseMIT

Previously,Type::isSatisfiedBy was not traversing the type tree, which means that:

$specification =staticfn (Type$type):bool =>$typeinstanceof ObjectType;return Type::collection(Type::object(Foo::class))->isSatisfiedBy($specification);

was unexpectedly returningfalse.
This PR fixes it.

@stof
Copy link
Member

a collection of object isnot satisfying theobject type. An array isnot an object. This PR is the one introducing an unexpected behavior while the current code works fine.

-1 for this PR.

@mtarld
Copy link
ContributorAuthor

Sorry, the example was not clear enough,Type::collection(Type::object(Foo::class)) means thatFoois the collection. I should have written the following:

Type::collection(type: Type::object(\Iterator::class), value: Type::int())->isSatisfiedBy($specification);

Which will check the whole type, and theIterator type, but not theint type.

@mtarldmtarld requested a review fromstofMarch 6, 2025 07:23
@fabpot
Copy link
Member

Thank you@mtarld.

@fabpotfabpot merged commitbc82b67 intosymfony:7.2Mar 24, 2025
10 of 11 checks passed
@mtarldmtarld deleted the fix/is-satisfied-by branchMarch 24, 2025 09:19
@fabpotfabpot mentioned this pull requestMar 28, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@chalasrchalasrchalasr approved these changes

@stofstofAwaiting requested review from stof

Assignees
No one assigned
Projects
None yet
Milestone
7.2
Development

Successfully merging this pull request may close these issues.

6 participants
@mtarld@stof@fabpot@nicolas-grekas@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp