Skip to content

Preg match regex mutators #2#1455

Merged
maks-rafalko merged 13 commits intomasterfrom
feature/regex-mutators
Dec 9, 2020
Merged

Preg match regex mutators #2#1455
maks-rafalko merged 13 commits intomasterfrom
feature/regex-mutators

Conversation

@maks-rafalko
Copy link
Member

@maks-rafalko maks-rafalko commented Dec 7, 2020

This PR is a rebirth of #388

Fixes #324

2 new mutations here:

# 1
- preg_match("/^test$/", $string));
+ preg_match("/^test/", $string));

# 2
- preg_match("/^test$/", $string));
+ preg_match("/test$/", $string));

Other possible mutations will be done in a separate PRs after this one is merged.

<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.1.1@16bfbd9224698bd738c665f33039fade2a1a3977">
<file src="src/Mutator/Regex/PregMatchRemoveCaret.php">
<ImpureFunctionCall occurrences="1">
Copy link
Member Author

@maks-rafalko maks-rafalko Dec 7, 2020

Choose a reason for hiding this comment

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

Unfortunately, thecodingmachine/safe package does not support Psalm's annotations yet, and functions are missing @pure annotation, that's why we have issues reported by Psalm.

Tried https://github.com/hectorj/safe-php-psalm-plugin, but it doesn't work properly, so for now it's ok to suppress them

@maks-rafalko maks-rafalko added this to the 0.21.0 milestone Dec 7, 2020
@maks-rafalko maks-rafalko mentioned this pull request Dec 7, 2020
4 tasks
@maks-rafalko maks-rafalko force-pushed the feature/regex-mutators branch from 4ef0d13 to d0dd870 Compare December 8, 2020 14:05
maks-rafalko added a commit to infection/site that referenced this pull request Dec 8, 2020
Copy link
Member

@BackEndTea BackEndTea left a comment

Choose a reason for hiding this comment

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

1 nitpick

@maks-rafalko maks-rafalko merged commit 3b28bba into master Dec 9, 2020
@maks-rafalko maks-rafalko deleted the feature/regex-mutators branch December 9, 2020 22:38
@maks-rafalko
Copy link
Member Author

Thank you @BackEndTea

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.

Implement Regex Mutator

3 participants

Comments