Skip to content

Base the install command on package-tools' InstallCommand - #37

Merged
imanimanyara merged 1 commit into
mainfrom
install-command-package-tools-base
Oct 5, 2026
Merged

imanimanyara merged 1 commit into
mainfrom
install-command-package-tools-base

Conversation

@imanimanyara

Copy link
Copy Markdown
Member

Owner decision 6 ("traits"), the pattern proven in laranail/captcha#24.

laranail::confetti.install now extends laranail/package-tools' InstallCommand and keeps laranail/console's display API and run lifecycle by using its InteractsWithConsoleServices and InteractsWithConsoleWriter traits. No new dependency direction: both packages were already required.

  • Signature and description moved to constants; the constructor takes the Package, passes hidden: false (the command was listed before), restores the description the base overwrites, and boots console support.
  • Bound in packageRegistered() because the container cannot autowire Package; still registered by class name in hasCommands().
  • handle()'s ConfettiConfig parameter is now optional (?ConfettiConfig $config = null), because a required parameter would be an incompatible override of the base's handle(): int. Artisan still method-injects it; the fallback resolves the same singleton.
  • No $commandAliases were set, so none to re-apply.

tests/Feature/InstallCommandContractTest.php pins the name, aliases, description, listing visibility, the --force option, no arguments, every output line in both asset modes, and the exit code. The behaviour assertions passed against the old base before the change; the inheritance assertion failed there and passes now.

Local: Pest 188 passed, PHPStan clean, Pint clean, Rector clean, lint greps clean.

Owner decision 6: install commands subclass laranail/package-tools'
InstallCommand and keep laranail/console's display API through its two
traits, so neither package depends on the other. A contract test pins
the name, option, description, visibility, output and exit codes; it
passed against the old base before the change.
Copilot AI balanced review requested due to automatic review settings October 5, 2026 09:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@imanimanyara
imanimanyara merged commit 15e5291 into main Oct 5, 2026
13 checks passed
@imanimanyara
imanimanyara deleted the install-command-package-tools-base branch October 5, 2026 10:04
@imanimanyara
imanimanyara restored the install-command-package-tools-base branch November 8, 2026 10:12
@imanimanyara
imanimanyara deleted the install-command-package-tools-base branch November 13, 2026 18:23
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.

2 participants