Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PHP 8 specific NullSafe operator mutators #1457

Merged
merged 6 commits into from Dec 8, 2020

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.

None yet

2 participants