Skip to content

Unexpected behavior with JoinStringConcatRector rule #7667

@vralle

Description

@vralle

Bug Report

Subject Details
Rector v0.15.0
PHP v8.1.0

Minimal PHP Code Causing Issue

rector --dry-run in terminal of VS Code:

protected function isGzipped(string $content): bool
     {
-        return mb_strpos($content, "\x1f" . "\x8b" . "\x08") === 0; // phpcs:ignore Generic.Strings.UnnecessaryStringConcat.Found
+        return mb_strpos($content, ') === 0; // phpcs:ignore Generic.Strings.UnnecessaryStringConcat.Found
     }

It is not entirely clear whether the Rector breaks the code, or whether these are output features in the terminal. The changes look unusable, so no action has been taken.

Expected Behaviour

Multibyte characters must remain unchanged in the code and for display in the terminal.

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