Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions rules/CodeQuality/Rector/FuncCall/SimplifyRegexPatternRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ final class SimplifyRegexPatternRector extends AbstractRector
* @var array<string, string>
*/
private const COMPLEX_PATTERN_TO_SIMPLE = [
Copy link
Member

Choose a reason for hiding this comment

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

Could you add note about the scoper issue? So we at least know "why" , since there is no test fixture to verify

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

Copy link
Member Author

Choose a reason for hiding this comment

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

The fixture is exists, see https://github.com/rectorphp/rector-src/pull/7390/files#diff-50a42149759f087eb3dce4cbe895b8f759b6e1b26013eb262d8a088c39706e03

It just issue with php-scoper.

I will look if it can simply be handled by double quote.

Copy link
Member Author

Choose a reason for hiding this comment

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

Properly resolved with double quoted:

on dev-main rectorphp/rector@d61e2b7

Tested locally, working ok.

I will add the note comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

'[0-9]' => '\\d',
'[a-zA-Z0-9_]' => '\\w',
'[A-Za-z0-9_]' => '\\w',
'[0-9a-zA-Z_]' => '\\w',
'[0-9A-Za-z_]' => '\\w',
'[\r\n\t\f\v ]' => '\\s',
'[0-9]' => '\\\d',
'[a-zA-Z0-9_]' => '\\\w',
'[A-Za-z0-9_]' => '\\\w',
'[0-9a-zA-Z_]' => '\\\w',
'[0-9A-Za-z_]' => '\\\w',
'[\r\n\t\f\v ]' => '\\\s',
];

public function __construct(
Expand Down