Skip to content

Apply conservative Rector cleanup#54

Merged
dereuromark merged 6 commits into
masterfrom
rector-cleanup-20260524
May 25, 2026
Merged

Apply conservative Rector cleanup#54
dereuromark merged 6 commits into
masterfrom
rector-cleanup-20260524

Conversation

@dereuromark
Copy link
Copy Markdown
Owner

Applies the same conservative, behavior-neutral Rector cleanup pass as used in dereuromark/cakephp-ide-helper#452, but without committing Rector config or dependency wiring here.

  • dead-code and code-quality simplifications only
  • excludes the same unsafe / opinionated ruleset areas
  • keeps the PR scope to generated cleanup changes in src/ and tests/

This was generated with a temporary local Rector config and followed with CS fixes where needed.

Copilot AI review requested due to automatic review settings May 24, 2026 16:57
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 24, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.43%. Comparing base (dc0db99) to head (ff0d344).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/Engine/MathEngine.php 80.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #54      +/-   ##
============================================
+ Coverage     86.94%   87.43%   +0.49%     
+ Complexity      232      231       -1     
============================================
  Files            18       18              
  Lines           789      780       -9     
============================================
- Hits            686      682       -4     
+ Misses          103       98       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Applies a conservative Rector-driven cleanup pass across src/ and tests/, aiming for behavior-neutral simplifications and modern PHP idioms consistent with PHP >=8.2 in this plugin.

Changes:

  • Modernizes syntax (e.g., catch without variable, str_starts_with(), match, ternaries) and simplifies boolean-returning conditionals.
  • Refactors some controller view variable passing from compact() to explicit arrays.
  • Minor string concatenation/return simplifications in helpers/behaviors.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/schema.php Removes unused exception variable via PHP 8+ catch syntax.
tests/bootstrap.php Replaces substr() OS check with str_starts_with().
src/View/Helper/CaptchaHelper.php Simplifies concatenation/return when appending passive field HTML.
src/Model/Behavior/PassiveCaptchaBehavior.php Removes redundant (string) cast in log message concatenation.
src/Model/Behavior/CaptchaBehavior.php Simplifies min/max time validations and small UUID assignment refactor.
src/Engine/MathEngine.php Replaces switch with match for output format handling.
src/Engine/Math/SimpleMath.php Simplifies operator conditional to a ternary.
src/Controller/CaptchaController.php Switches $this->set(compact(...)) to explicit array.
src/Controller/Admin/IpsController.php Switches $this->set(compact(...)) to explicit arrays.
src/Controller/Admin/CaptchaController.php Switches $this->set(compact(...)) to explicit arrays.
Comments suppressed due to low confidence (1)

src/Engine/MathEngine.php:90

  • The new match arms are indented with spaces while the surrounding file uses tabs. This can cause inconsistent formatting and potentially fail coding-standard checks; please align indentation with the rest of the file.
		match ($this->_config['imageFormat']) {
            static::FORMAT_JPEG => imagejpeg($formula->image),
            static::FORMAT_PNG => imagepng($formula->image),
            default => ob_get_clean() ?: '',
        };

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Engine/MathEngine.php Outdated
Comment thread src/Model/Behavior/CaptchaBehavior.php
Copilot AI review requested due to automatic review settings May 24, 2026 17:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings May 25, 2026 03:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@dereuromark dereuromark merged commit d8b0e87 into master May 25, 2026
16 checks passed
@dereuromark dereuromark deleted the rector-cleanup-20260524 branch May 25, 2026 03:18
@dereuromark dereuromark restored the rector-cleanup-20260524 branch May 25, 2026 12:29
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