Fix tenants:seed command name - #1478
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesTenant seed command
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Artisan
participant SeedCommand
participant TenantSeed
Artisan->>SeedCommand: register db:seed
Artisan->>TenantSeed: configure tenant options
TenantSeed->>TenantSeed: set name to tenants:seed
Artisan-->>Artisan: retain both command registrations
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1478 +/- ##
============================================
- Coverage 86.65% 86.64% -0.01%
- Complexity 1220 1221 +1
============================================
Files 186 186
Lines 3589 3588 -1
============================================
- Hits 3110 3109 -1
Misses 479 479 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Replaces the version_compare hack with a configure() override that sets the command name, which works regardless of whether the installed Laravel version's SeedCommand uses $name or $signature.
54f9c54 to
d2c96bb
Compare
|
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. |
Fixes #1474.
Replaces the
version_comparecheck inSeed::__construct()with aconfigure()override that callssetName('tenants:seed').configure()always runs after the command name is set by Symfony'sCommandconstructor, regardless of whether the installed Laravel version'sSeedCommandsets its name via$name(pre-13.24) or$signature(13.24+), so this works across versions without checkingapp()->version().configure()is also the general place to add, remove, or tweak a parent command's arguments/options ($this->addArgument(),$this->addOption(), or$this->getDefinition()->remove*()), since it's guaranteed to run after the parent's own definition is built and before the command executes. Worth keeping in mind for other commands here that extend Laravel's built-in ones and need to adjust their inherited signature.Summary by CodeRabbit
Bug Fixes
Tests