Apply conservative Rector cleanup#55
Conversation
There was a problem hiding this comment.
Pull request overview
Conservative Rector/PHPCS cleanup pass across the plugin, modernizing some PHP syntax and doing small refactors while aiming to preserve behavior.
Changes:
- Modernized PHP syntax (e.g.,
str_starts_with(),match, catch without variable, ternaries) and simplified return paths. - Minor refactors in captcha validation helpers/behaviors and math rendering.
- Small static-analysis/docblock adjustments in controller code.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/schema.php | Uses catch without an unused exception variable during fixture schema reflection. |
| tests/bootstrap.php | Simplifies Windows detection using str_starts_with(). |
| src/View/Helper/CaptchaHelper.php | Simplifies render return concatenation for passive honeypot field output. |
| src/Model/Behavior/PassiveCaptchaBehavior.php | Adjusts logging string concatenation in honeypot validation rule. |
| src/Model/Behavior/CaptchaBehavior.php | Simplifies min/max time comparisons and minor UUID empty check refactor. |
| src/Engine/MathEngine.php | Refactors image output selection to match within output buffering. |
| src/Engine/Math/SimpleMath.php | Collapses arithmetic branch to a ternary expression. |
| src/Controller/CaptchaController.php | Adds inline docblock type annotation for $captcha. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #55 +/- ##
============================================
- Coverage 86.94% 86.92% -0.03%
+ Complexity 232 231 -1
============================================
Files 18 18
Lines 789 780 -9
============================================
- Hits 686 678 -8
+ Misses 103 102 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Cleanup-only Rector follow-up PR. No Rector dependency or config is added here; this keeps the branch focused on conservative code cleanup only.