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

Preg match regex mutators #2 #1455

Merged
merged 13 commits into from Dec 9, 2020
Merged

Preg match regex mutators #2 #1455

merged 13 commits into from Dec 9, 2020

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

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
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

src/Mutator/Regex/PregMatchRemoveCaret.php Outdated Show resolved Hide resolved
@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