You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix Rector findings and run rector:check in CI #587
composer rector:check fails on master (22 files would change), and CI does not run it, so the findings were never caught. Fix them and add the check to the workflow so they stay fixed.
Current state (checked on master)
vendor/bin/rector process --dry-run reports 22 files:
IfToNullCoalescingAssignRector (17): if (!isset($x)) { $x = … } becomes $x ??= … in the factories (App, Archive, Auth, Cache, Captcha, Encryption, Logger, Mailer, RateLimit, Renderer, Session, FileSystem), Config, DebuggerStore, DiContainer, SleekDbal and Validator.
Return types (2 files): env(): mixed, and CurlAdapter::getId(): int and CurlAdapter::getResponseCookies(): array.
.github/workflows/php.yml runs composer cs:check and composer phpstan, but not composer rector:check, although the script exists in composer.json.
Proposed change
Apply the findings with composer rector:fix, then composer cs:fix.
Review the return-type changes in CurlAdapter and env() by hand against their interfaces, subclasses and docblocks; keep or drop each one deliberately.
Add a Run Rector step (composer rector:check) to php.yml, right after Run PHPStan.
Breaking changes
None expected. The refactors are behavior-preserving. The new return types are the only change visible to callers, hence the manual review in step 2.
Tests
composer test passes unchanged; the findings must not need test edits.
composer rector:check, composer cs:check and composer phpstan pass.
Acceptance criteria
composer rector:check exits 0 on the branch.
The workflow runs it after PHPStan, and CI is green on PHP 8.0, 8.1 and 8.2.
Out of scope
Adding or enabling new Rector sets.
The same step in quantum-php/project, which gets its own change.
Activity
[quantum-php#587] Return the cached factory instance in one statement
[#587] Fix the Rector findings and run rector:check in CI