Fix Technical Debt Plugin configuration parameters

This commit is contained in:
bochkovprivate 2017-04-06 19:34:20 +07:00
commit acf25afdd6
2 changed files with 20 additions and 2 deletions

View file

@ -75,6 +75,21 @@ class TechnicalDebt extends Plugin implements ZeroConfigPluginInterface
if (isset($options['zero_config']) && $options['zero_config']) {
$this->allowed_errors = -1;
}
$this->setOptions($options);
}
/**
* Handle this plugin's options.
* @param $options
*/
protected function setOptions($options)
{
foreach (array('directory', 'path', 'ignore', 'allowed_errors') as $key) {
if (array_key_exists($key, $options)) {
$this->{$key} = $options[$key];
}
}
}
/**