Skip to content

Add PHP 8 specific NullSafe operator mutators#1457

Merged
maks-rafalko merged 6 commits intomasterfrom
null-safe-call-mutators
Dec 8, 2020
Merged

Add PHP 8 specific NullSafe operator mutators#1457
maks-rafalko merged 6 commits intomasterfrom
null-safe-call-mutators

Conversation

@sidz
Copy link
Member

@sidz sidz commented Dec 7, 2020

This PR:

NullSafeMethodCall Mutator:

- $object?->getObject()?->getName()
+ $object->getObject()?->getName()

and

- $object?->getObject()?->getName()
+ $object?->getObject()->getName()

NullSafePropertyCall Mutator:

- $object?->property?->name
+ $object->property?->name

and

- $object?->property?->name
+ $object?->property->name

I'm not sure how to exclude these mutators from the schema.json for case when Infection is executed on PHP < 8. Or maybe it won't be an issue as they won't be executed anyway due to PHP_VERSION_ID check.

@sidz sidz added the Mutator label Dec 7, 2020
@sidz sidz self-assigned this Dec 7, 2020
@maks-rafalko maks-rafalko added this to the 0.21.0 milestone Dec 7, 2020
Copy link
Member

@maks-rafalko maks-rafalko left a comment

Choose a reason for hiding this comment

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

👌

@maks-rafalko
Copy link
Member

Cool, thank you @sidz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments