Skip to content

Conversation

gharlan
Copy link
Member

@gharlan gharlan commented Aug 14, 2025

No description provided.


return substr($help[0], 0, strrpos($help[0], "\n") - 1)
.substr($help[1], strpos($help[1], "\n"));
return Preg::replace('@\v\V*<comment>--dry-run</comment>\V*\v@', '', parent::getHelp());
Copy link
Member Author

Choose a reason for hiding this comment

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

For me this regex is easier to understand than previous code. And it avoids the phpstan errors.

(It may be slower, not sure. But performance doesn't matter here.)

@coveralls
Copy link

Coverage Status

coverage: 94.725% (+0.006%) from 94.719%
when pulling c44adc2 on gharlan:check-command-regex
into 516a12b on PHP-CS-Fixer:master.

@kubawerlos kubawerlos merged commit 1ea1ff8 into PHP-CS-Fixer:master Aug 15, 2025
31 checks passed
@gharlan gharlan deleted the check-command-regex branch August 24, 2025 21:31
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.

3 participants