Skip to content

feat!: update Rector config style - #104

Merged
owenvoke merged 2 commits into
mainfrom
feature/rector-config
Aug 5, 2026
Merged

feat!: update Rector config style#104
owenvoke merged 2 commits into
mainfrom
feature/rector-config

Conversation

@owenvoke

@owenvoke owenvoke commented Aug 4, 2026

Copy link
Copy Markdown
Member

This was meant to be introduced in 4.x, but will need a new major release as 5.x

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added updated configuration support for code analysis and automated refactoring across application, configuration, and test paths.
  • Refactor

    • Modernized configuration handling for compatibility with newer tooling.
    • Streamlined internal checks and visitors with readonly properties and constructor promotion.
    • Added explicit typing to code-quality configuration constants.
  • Chores

    • Simplified test configuration and removed an unused development utility.
    • Reordered configured paths for consistency.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f441c52d-ec48-4d30-9847-2c9c616d7a70

📥 Commits

Reviewing files that changed from the base of the PR and between 11b0d46 and baf9912.

📒 Files selected for processing (11)
  • composer.json
  • rector.php
  • src/PHPStan/Laravel/EnforceKebabCaseArtisanCommandsRule.php
  • src/PHPStan/Laravel/Migrations/RequireWithoutTimestampsRule.php
  • src/PHPStan/Laravel/Migrations/WithoutTimestampsVisitor.php
  • src/PHPStan/NamespaceBasedSuffixRule.php
  • src/Rector/WorksomeSetList.php
  • src/WorksomeRectorConfig.php
  • stubs/ecs.php.stub
  • stubs/rector.php.stub
  • tests/Rector/BaseRectorTestCase.php
💤 Files with no reviewable changes (2)
  • composer.json
  • src/PHPStan/Laravel/Migrations/RequireWithoutTimestampsRule.php
🚧 Files skipped from review as they are similar to previous changes (7)
  • stubs/ecs.php.stub
  • rector.php
  • src/PHPStan/Laravel/Migrations/WithoutTimestampsVisitor.php
  • src/PHPStan/Laravel/EnforceKebabCaseArtisanCommandsRule.php
  • src/WorksomeRectorConfig.php
  • src/PHPStan/NamespaceBasedSuffixRule.php
  • stubs/rector.php.stub

📝 Walkthrough

Walkthrough

The PR migrates Rector configuration to RectorConfigBuilder, updates Rector entry points and test configuration lookup, removes an unused development dependency, and applies readonly and explicit string declarations to selected PHPStan and Rector entities.

Changes

Rector and PHPStan updates

Layer / File(s) Summary
Rector builder configuration
src/WorksomeRectorConfig.php
WorksomeRectorConfig now exposes configure(): RectorConfigBuilder. It conditionally selects PHPStan or Larastan configuration and registers sets and rules through builder methods.
Rector configuration entry points
rector.php, stubs/rector.php.stub, stubs/ecs.php.stub, tests/Rector/BaseRectorTestCase.php, composer.json
The root and stub configurations use the updated Rector API and paths. The test base resolves configuration paths from Pest’s test filename. The spatie/invade development dependency is removed.
PHPStan declaration cleanup
src/PHPStan/..., src/Rector/WorksomeSetList.php
Selected PHPStan properties are now readonly. Rector set-list constants explicitly declare the string type.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Rector
  participant WorksomeRectorConfig
  participant PHPStanConfig as PHPStan configuration
  Rector->>WorksomeRectorConfig: Call configure()
  WorksomeRectorConfig->>PHPStanConfig: Select available configuration
  WorksomeRectorConfig-->>Rector: Return configured RectorConfigBuilder
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: updating the Rector configuration style, including a breaking API migration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/rector-config

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@owenvoke
owenvoke force-pushed the feature/rector-config branch from b143613 to b0a1d07 Compare August 4, 2026 15:48
@owenvoke
owenvoke force-pushed the feature/rector-config branch from b0a1d07 to af4cb4d Compare August 5, 2026 08:20

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/WorksomeRectorConfig.php`:
- Around line 25-33: Update WorksomeRectorConfig’s withPHPStanConfigs() setup to
include Larastan’s PHPStan extension configuration when the standard Larastan
bootstrap file exists, while preserving the existing project phpstan.neon
detection and bootstrap configuration. Use the corresponding Larastan extension
config path alongside the bootstrap path so Rector loads it explicitly.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9f7f9c79-997d-43f5-aab5-d72324257ac0

📥 Commits

Reviewing files that changed from the base of the PR and between 11b0d46 and af4cb4d.

📒 Files selected for processing (8)
  • rector.php
  • src/PHPStan/Laravel/EnforceKebabCaseArtisanCommandsRule.php
  • src/PHPStan/Laravel/Migrations/RequireWithoutTimestampsRule.php
  • src/PHPStan/Laravel/Migrations/WithoutTimestampsVisitor.php
  • src/PHPStan/NamespaceBasedSuffixRule.php
  • src/WorksomeRectorConfig.php
  • stubs/ecs.php.stub
  • stubs/rector.php.stub
💤 Files with no reviewable changes (1)
  • src/PHPStan/Laravel/Migrations/RequireWithoutTimestampsRule.php

Comment thread src/WorksomeRectorConfig.php Outdated
@owenvoke
owenvoke force-pushed the feature/rector-config branch from 8766f2c to baf9912 Compare August 5, 2026 10:15
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@owenvoke
owenvoke merged commit c016ddf into main Aug 5, 2026
6 checks passed
@owenvoke
owenvoke deleted the feature/rector-config branch August 5, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants