Show config actions and a result as Console output#8
Conversation
src/Plugin.php
Outdated
| $arguments = ['--config-set', 'installed_paths', implode(',', $this->installedPaths)]; | ||
| $paths = implode(',', $this->installedPaths); | ||
| $arguments = ['--config-set', $configKey, $paths]; | ||
| $this->io->write(sprintf('PHP CodeSniffer Config <info>%s</info> <comment>set to</comment> <info>%s</info>', $configKey, $paths)); |
There was a problem hiding this comment.
As a matter of cleanup, I would suggest assigning the message to a separate variable (instead of calling $this->io->write()) and placing the call to io->write outside of the if/else.
src/Plugin.php
Outdated
| { | ||
| // By default we delete the installed paths | ||
| $arguments = ['--config-delete', 'installed_paths']; | ||
| $configKey = 'installed_paths'; |
There was a problem hiding this comment.
This configKey (installed_paths) is used multiple times in this class / Plugin (e.g. line 121).
I would really like to keep a single style. Right now it used as a variable here, while being used directly elsewhere. I would suggest on moving it into a class constant.
src/Plugin.php
Outdated
| $arguments = ['--config-set', $configKey, $paths]; | ||
| $this->io->write(sprintf('PHP CodeSniffer Config <info>%s</info> <comment>set to</comment> <info>%s</info>', $configKey, $paths)); | ||
| } | ||
| else { |
There was a problem hiding this comment.
Violates PRS-2: 5.1. if, elseif, else.
Please correct and place else on the same line as the closing bracket of the above if statement.
|
Thanks for the review @frenck @Potherca -- I've pushed updates addressing your suggestions. Love your work. I was a little unsure about the constant name. Do I go for the better readability (ie. |
|
@christopher-hopper To (mis)quote a poem by T.S. Eliot:
😁 |
Proposed Changes
-v(verbose) flag is used, also output PHP CodeSniffer config command resultsRelated Issues
Fixes #7