Skip to content

Keep Laravel's command signatures and tidy the new-group notice - #2

Merged
jaspertey merged 3 commits into
mainfrom
fix/laravel-signatures
Oct 8, 2026
Merged

jaspertey merged 3 commits into
mainfrom
fix/laravel-signatures

Conversation

@jaspertey

Copy link
Copy Markdown
Member

Fixes found while rebuilding laravel-ddd on mod.

  • Subclasses of the mod:* commands can override their methods with Laravel's own signatures again. 0.1.0 declared getStub(): string, and configure(): void where Symfony Console 7 leaves configure() untyped, so an override without the return type was a fatal error. A new test compares every mod command method with its Laravel or Symfony parent, so a stricter signature can't come back.
  • "Created new " is printed only when the file is written, not when the command then refuses (an unknown policy guard, an invalid observer model, an unknown controller type).
  • A group's own type folders are no longer listed as existing groups in the new-group notice.

0.1.0 declared getStub(): string over Laravel's untyped getStub(), and
configure(): void where Symfony Console 7 leaves configure() untyped, so a
subclass overriding either as the framework declares it was a fatal error.

getStub() is untyped again (ConfigCommand keeps ConfigMakeCommand's
string). --in is now added from specifyParameters() and
configureUsingFluentDefinition(), untyped in every supported Laravel, since
no configure() override can match both Symfony 7 and 8.

A guard test reflects every command's overrides against its framework
parent, and fixture subclasses are loaded in their own process.
The "Created new <group>" notice was printed while the plan was resolved,
before the native generator ran its own checks, so a command that then
refused (an unknown policy guard, an invalid observer model, an unknown
controller type) still announced a group it never created. The notice is
now held and printed from sortImports(), which the native generator calls
with the built class just before writing it; a host handle() that writes
the class itself gets it once the file exists.

Inside a nested group, the group's own kind folders (Billing/Controllers)
were listed as existing groups when the root also places classes right in
the group, as laravel-ddd's catch-all kinds do. GroupFolders now leaves
out the root's kind folders at the level it inspects.
@jaspertey
jaspertey merged commit d2123d3 into main Oct 8, 2026
20 checks passed
@jaspertey
jaspertey deleted the fix/laravel-signatures branch October 8, 2026 23:09
@jaspertey jaspertey mentioned this pull request Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant