Skip to content

Use StrContainsRector in a php7 + polyfill codebase #7867

@staabm

Description

@staabm

Bug Report

Subject Details
Rector version e.g. 0.15.23

I want to appy the StrContainsRector rector on a php7 codebase.
since my appplication will ship with a symfony polyfill the method is available at runtime.

in my rector config I use $rectorConfig->phpVersion(70200); to make sure rectors will not produce invalid code.

Minimal PHP Code Causing Issue

https://getrector.com/demo/ce3be4b4-a9c5-445f-8739-1e4954817021

vs.

https://getrector.com/demo/d62d920f-835c-4869-975f-0f51de3e97c1

Expected Behaviour

I search for way which allows me to apply StrContainsRector in tandem with $rectorConfig->phpVersion(70200); as I don't want other rules produce invalid php7 output

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions