Refactored plugin PhpCsFixer (Added more backward compatibility). Issue #63.
This commit is contained in:
parent
9c1dcbf6a9
commit
e2b6f5aefd
2 changed files with 20 additions and 3 deletions
|
|
@ -13,8 +13,8 @@ use PHPCensor\Plugin;
|
|||
*/
|
||||
class PhpCsFixer extends Plugin
|
||||
{
|
||||
protected $directory = null;
|
||||
protected $args = '';
|
||||
protected $directory = null;
|
||||
protected $args = '';
|
||||
|
||||
/**
|
||||
* @return string
|
||||
|
|
@ -34,6 +34,18 @@ class PhpCsFixer extends Plugin
|
|||
if (!empty($options['args'])) {
|
||||
$this->args = $options['args'];
|
||||
}
|
||||
|
||||
if (isset($options['verbose']) && $options['verbose']) {
|
||||
$this->args .= ' --verbose';
|
||||
}
|
||||
|
||||
if (isset($options['diff']) && $options['diff']) {
|
||||
$this->args .= ' --diff';
|
||||
}
|
||||
|
||||
if (isset($options['rules']) && $options['rules']) {
|
||||
$this->args .= ' --rules=' . $options['rules'];
|
||||
}
|
||||
|
||||
if (isset($options['directory']) && $options['directory']) {
|
||||
$this->directory = $builder->interpolate($options['directory']);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue