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] AddArrayShapeType::$sealed#59981

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.3frommtarld:feat/array-shape-sealed
Mar 26, 2025

Conversation

mtarld
Copy link
Contributor

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

Implement sealed syntax for array shape type, as suggested in#59827 (comment).

@mtarld
Copy link
ContributorAuthor

As 7.3 has been released yet, I think that 8.2 low-deps failures can be ignored.

@mtarldmtarld requested a review fromGromNaNMarch 15, 2025 13:29
@mtarldmtarldforce-pushed thefeat/array-shape-sealed branch from62a0dab to1e70c86CompareMarch 15, 2025 23:20
@mtarldmtarldforce-pushed thefeat/array-shape-sealed branch from1e70c86 to9030a26CompareMarch 16, 2025 12:04
@@ -56,6 +60,14 @@ public function __construct(array $shape)
ksort($sortedShape);

$this->shape = $sortedShape;

if ($this->extraKeyType xor $this->extraValueType) {
throw new InvalidArgumentException(\sprintf('You must provide as value for "$%s" when "$%s" is provided.', ...($this->extraKeyType ? ['extraValueType', 'extraKeyType'] : ['extraKeyType', 'extraValueType'])));
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this error message.

@@ -56,6 +60,14 @@ public function __construct(array $shape)
ksort($sortedShape);

$this->shape = $sortedShape;

if ($this->extraKeyType xor $this->extraValueType) {
throw new InvalidArgumentException(\sprintf('You must provide as value for "$%s" when "$%s" is provided.', ...($this->extraKeyType ? ['extraValueType', 'extraKeyType'] : ['extraKeyType', 'extraValueType'])));
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
thrownewInvalidArgumentException(\sprintf('You must provideas value for "$%s" when "$%s" is provided.',...($this->extraKeyType ?['extraValueType','extraKeyType'] : ['extraKeyType','extraValueType'])));
thrownewInvalidArgumentException(\sprintf('You must providea value for "$%s" when "$%s" is provided.',$this->extraKeyType ?'extraValueType' :'extraKeyType',$this->extraKeyType ?'extraKeyType' :'extraValueType'));

chalasr reacted with thumbs up emoji
@fabpotfabpotforce-pushed thefeat/array-shape-sealed branch from0bd93a0 tofded1ebCompareMarch 26, 2025 07:17
@fabpot
Copy link
Member

Thank you@mtarld.

@fabpotfabpot merged commit452ad95 intosymfony:7.3Mar 26, 2025
4 of 11 checks passed
@fabpotfabpot mentioned this pull requestMay 2, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@stofstofstof left review comments

@fabpotfabpotfabpot approved these changes

@GromNaNGromNaNGromNaN approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
7.3
Development

Successfully merging this pull request may close these issues.

5 participants
@mtarld@fabpot@GromNaN@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp