Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/en/plugins/technical_dept.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ Configuration
-------------

### Options

* **searches** - Optional - Case-insensitive array of terms to search for. Defaults to TODO, TO DO, FIXME and FIX ME.
* **allowed_errors** [int, optional] - The error limit for a successful build (default: 0). -1 disables errors. Setting allowed_errors in conjunction with zero_config will override zero_config.
* **suffixes** [array, optional] - An array of file extensions to check (default: 'php')
* **directory** [string, optional] - directory to inspect (default: build root)
* **ignore** [array, optional] - directory to ignore (default: inherits ignores specified in setup)
* **searches** [array, optional] - Optional - Case-insensitive array of terms to search for. Defaults to TODO, TO DO, FIXME and FIX ME.
15 changes: 15 additions & 0 deletions src/PHPCensor/Plugin/TechnicalDebt.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,21 @@ public function __construct(Builder $builder, Build $build, array $options = [])
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];
}
}
}

/**
Expand Down