Repository navigation
Issue/587 Fix the Rector findings and run rector:check in CI - #588
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
andrey-smaelov
left a comment
There was a problem hiding this comment.
Small style nit/suggestion for consistency:
In several factory methods you assign then return, e.g.
$this->instances[$adapter] ??= $this->createInstance($adapterClass, $adapter);
return $this->instances[$adapter];You can simplify this to the equivalent one-liner:
return $this->instances[$adapter] ??= $this->createInstance($adapterClass, $adapter);
Closes #587
What changed
src/:if (!isset($x)) { $x = … }becomes$x ??= …(17 files: the factories,Config,DebuggerStore,DiContainer,SleekDbal,Validator).instanceofchecks (Config,FileAdapter,AssetManager).env(),CurlAdapter::getId()andCurlAdapter::getResponseCookies(), with their docblocks aligned to the native types.Run Rectorstep (composer rector:check) to.github/workflows/php.yml, right afterRun PHPStan.Changedentry to the 3.1.0 changelog.Why
composer rector:checkfailed onmasterfor 22 files, and CI did not run it, so new findinthe fixes applied andthe step added,rector.phpis enforced the same way PHP-CS-Fixer and PHPStan are.Breaking changes
None expected. The refactors keep behavior; the only change visible to callers is the three new return types.
CurlAdapterhas no subclass in the framework and its interface has no native return types, so the narrowed types are compatible.Testing
composer rector:checkexits 0 (22 files before).Notes
instanceofchecks inConfigandFileAdapterguard a lazily initialized?Dataproperty. Replacing them with a non-nullable container is a larger change and is out of scope here.Summary by CodeRabbit