Skip to content

Use codingmachine/safe#745

Merged
maks-rafalko merged 1 commit intoinfection:masterfrom
BackEndTea:chore/safe
Jul 14, 2019
Merged

Use codingmachine/safe#745
maks-rafalko merged 1 commit intoinfection:masterfrom
BackEndTea:chore/safe

Conversation

@BackEndTea
Copy link
Copy Markdown
Member

This PR:

I can't fix everything at this moment, for example preg_replace has different return types bases on its parameters, and PHPStan can't understand that from the safe function. So i've opted to keep those as is right now.

Copy link
Copy Markdown

@tests-checker tests-checker Bot left a comment

Choose a reason for hiding this comment

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

Thank you for contributing to Infection. We noticed you didn't add any tests. Could you please add them to make sure everything works as expected?

Copy link
Copy Markdown
Member

@maks-rafalko maks-rafalko left a comment

Choose a reason for hiding this comment

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

Cool

what about adding phpstan rule to force using these functions?

We, and especially new contributors, will 100% forget to import safe's functions.

@BackEndTea
Copy link
Copy Markdown
Member Author

We can't add PHPStan plugins, because we use the phar, and the plugins require to use a composer dependency. (Due to scoping of the phar etc)

@maks-rafalko
Copy link
Copy Markdown
Member

Understood. Thank you @BackEndTea

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