Skip to content

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

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

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

Conversation

@imanimanyara

Copy link
Copy Markdown
Member

Summary

laranail::pdf.install now extends laranail/package-tools' InstallCommand and keeps laranail/console's display API by using its InteractsWithConsoleServices and InteractsWithConsoleWriter traits, matching laranail/captcha#24. No new dependency direction.

  • Signature and description move into constants; the constructor passes hidden: false so the command stays listed, restores its own description, and boots console support.
  • The provider binds the command in packageRegistered() because the new base takes the Package in its constructor.
  • handle() takes DriverRegistry as an optional parameter, still injected by the container, because the base declares handle(): int and a required parameter would not be a compatible override.

Contract

tests/Feature/InstallCommandContractTest.php pins name, aliases, description, isHidden(), the --force option and its value mode, no arguments, key output lines and exit code 0. Written first: the behaviour assertions passed on the old base and the inheritance assertion failed.

Local checks

  • Pest: 87 passed, 1 skipped
  • PHPStan (level max): no errors
  • Pint and Rector: clean

laranail::pdf.install now extends package-tools' install base and keeps
console's display API through its two traits, so neither package depends
on the other. A contract test pins the name, option, description,
listing visibility, output and exit codes against the old base.
Copilot AI balanced review requested due to automatic review settings October 5, 2026 09:25

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 127b4b4 into main Oct 5, 2026
14 checks passed
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