Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Aug 22, 2024

as described in #34 (comment)

$matchesType = new ConstantArrayType(
$matchesType->getKeyTypes(),
array_map(static function (Type $valueType): Type {
if (count($valueType->getConstantArrays()) === 1) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

when PREG_OFFSET_CAPTURE the $valueType is again a constant-array-type.

TypeCombinator::removeNull does not deep iterate into arrays

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used the same logic already arround, but I guess we will get problems in the future with it when patterns are used which return more then 1 constant array (maybe one of the tagged union cases)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@staabm staabm changed the title Fix null-removeal on nested captured-arrays Fix null-removal on nested captured-arrays Aug 22, 2024
@Seldaek
Copy link
Member

Seldaek commented Aug 23, 2024

Thanks, that solves it for replaceCallbackStrictGroups I think. The problem with isMatchAllStrictGroups and matchAllStrictGroups from #34 is still there tho right?

@Seldaek Seldaek merged commit c8bfe21 into composer:main Aug 23, 2024
@staabm staabm deleted the fix branch August 23, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants