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

Fix for Newline with EncapsedStringsToSprintfRector #5060

Closed
wants to merge 5 commits into from

Conversation

brucealdridge
Copy link
Contributor

Fix for #5032

count(
array_filter(
$argumentVariables,
fn($argumentVar): bool => $argumentVar instanceof ConstFetch && $argumentVar->name.'' === 'PHP_EOL'
Copy link
Member

Choose a reason for hiding this comment

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

argument->name . '' should can be (string) argument->name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@samsonasik thanks, guessing you're also building against >7.3 as it doesn't like the return type on the closure

@samsonasik
Copy link
Member

@brucealdridge I cherry-picked your commit at #5072

@brucealdridge
Copy link
Contributor Author

@samsonasik thank you! Haven't yet had the time to rewrite!

TomasVotruba pushed a commit that referenced this pull request Jan 2, 2021
…rintfRector (#5072)

* Add failing test fixture for EncapsedStringsToSprintfRector

# Failing Test for EncapsedStringsToSprintfRector

Based on https://getrector.org/demo/1b647b4f-dde9-4f90-b05e-74744045a3d1

* Fix for prefixed_eol.php.inc

* Check against PHP_EOL

* allowing newline to be prefixed as well

* [CodingStyle] Closes #5060 Fixes #5032 Add %s for pass PHP_EOL constant

* skip multiple eol

* use PHP_EOL const

* [ci-review] Rector Rectify

Co-authored-by: bruce aldridge <bruce@incode.co.nz>
Co-authored-by: rector-bot <tomas@getrector.org>
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