-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Console] Lazy commands, separate IO concerns, add forced resolve to command, and prittify and detail output #981
[Console] Lazy commands, separate IO concerns, add forced resolve to command, and prittify and detail output #981
Conversation
- added "--force" option to resolve command to force re-resolution regardless of cache state - added "--no-colors" options to output non-styled varient - added "--as-script" options to output in machine-readable varient - removed deprecated "--filters" options ("--filter" replaces it) - removed container-aware implementation of commands for explicit constructor-based dependencies - added commands as services in "Resources/config/imagine.xml" - added commands as services lazy loading functionality (on supported Symfony vers) via "command" tag - added new console style abstraction "Liip\ImagineBundle\Component\Console\Style\ImagineStyle" - rewrote/refactored command implementation (for cleanup and better organization) - pulled out common functionality between commands into "Liip\ImagineBundle\Command\CacheCommandTrait"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, one small notice, since php versions <= 5.5 are not maintained anymore, probably it would make sense to switch from array()
to []
?
*/ | ||
public function __construct(InputInterface $input, OutputInterface $output, bool $decoration = true) | ||
{ | ||
$this->io = new SymfonyStyle($input, $output); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wdyt about moving instantiation of a SymfonyStyle
to the factory and inject it in the constructor ?
cause new
call breaks extensibility here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole thing is old and a newer version needs to be pushed here soon. Also, since this PR was originally submitted we already changed our code style to favor short array construction and destruction. See: https://github.com/liip/LiipImagineBundle/blob/2.0/.php_cs.dist
since default branch was changed to |
@robfrawley i looked into a bunch of things on the bundle and hope to release a new version soon. do you plan to pick up this (and #993) again? both seem completely new features, so i see no problem releasing 2.2.0 without them. |
continued in #1222 |
This is the
2.0
version of #967. Included are commands with the following new features:The use of explicit dependencies (via the constructor), as well as the separation of concerns, results in relatively simple commands, despite the complex behavior and output styling introduced. See:
It is also worth noting that the bulk of the PR size is new and updated unit tests. The new command output for the cache resolve command looks like the following: