Adding rector commands in composer.json and fixing issues found by rector#445
Adding rector commands in composer.json and fixing issues found by rector#445armanist merged 1 commit intosoftberg:masterfrom
Conversation
📝 WalkthroughWalkthroughThe pull request enhances type safety across the codebase by introducing stricter parameter typing to class methods, adding a strict types declaration, and improving callback type annotations. Additionally, Rector build commands are integrated into composer.json for code quality automation. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #445 +/- ##
=========================================
Coverage 82.58% 82.58%
Complexity 2831 2831
=========================================
Files 243 243
Lines 7545 7545
=========================================
Hits 6231 6231
Misses 1314 1314 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/App/Helpers/misc.php (1)
25-26: Silence the unused callback parameter warning.Line 25 currently triggers an unused-parameter warning. Consider marking it intentionally unused.
♻️ Proposed tweak
- return preg_replace_callback('/{%\d+}/', function (array $matches) use (&$params): string { + return preg_replace_callback('/{%\d+}/', function (array $_matches) use (&$params): string { return array_shift($params) ?? ''; }, $subject) ?? $subject;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/App/Helpers/misc.php` around lines 25 - 26, The anonymous callback passed to preg_replace_callback in misc.php has an unused parameter $matches causing warnings; mark it intentionally unused by renaming the parameter (e.g., to $_ or $_matches) or otherwise discarding it so the linter knows it's intentional—update the callback signature in the preg_replace_callback call that currently reads function (array $matches) use (&$params): string { ... } to use an underscore-prefixed name or a single underscore parameter while leaving the body returning array_shift($params) ?? ''.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/App/Helpers/misc.php`:
- Around line 25-26: The anonymous callback passed to preg_replace_callback in
misc.php has an unused parameter $matches causing warnings; mark it
intentionally unused by renaming the parameter (e.g., to $_ or $_matches) or
otherwise discarding it so the linter knows it's intentional—update the callback
signature in the preg_replace_callback call that currently reads function (array
$matches) use (&$params): string { ... } to use an underscore-prefixed name or a
single underscore parameter while leaving the body returning
array_shift($params) ?? ''.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a995fffe-f82b-4e5f-9030-65ddac5315ba
📒 Files selected for processing (5)
composer.jsonsrc/App/Helpers/misc.phpsrc/Environment/Server.phpsrc/Mailer/Adapters/SmtpAdapter.phpsrc/Service/Factories/ServiceFactory.php
Summary by CodeRabbit
Chores
Refactor