Merging latest master
This commit is contained in:
commit
28d09275fd
83 changed files with 1283 additions and 69 deletions
|
|
@ -72,6 +72,13 @@ class PhpCodeSniffer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
|
|||
*/
|
||||
protected $ignore;
|
||||
|
||||
/**
|
||||
* Check if this plugin can be executed.
|
||||
* @param $stage
|
||||
* @param Builder $builder
|
||||
* @param Build $build
|
||||
* @return bool
|
||||
*/
|
||||
public static function canExecute($stage, Builder $builder, Build $build)
|
||||
{
|
||||
if ($stage == 'test') {
|
||||
|
|
@ -120,6 +127,10 @@ class PhpCodeSniffer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
|
|||
$this->setOptions($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle this plugin's options.
|
||||
* @param $options
|
||||
*/
|
||||
protected function setOptions($options)
|
||||
{
|
||||
foreach (array('directory', 'standard', 'path', 'ignore', 'allowed_warnings', 'allowed_errors') as $key) {
|
||||
|
|
@ -177,6 +188,10 @@ class PhpCodeSniffer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
|
|||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process options and produce an arguments string for PHPCS.
|
||||
* @return array
|
||||
*/
|
||||
protected function getFlags()
|
||||
{
|
||||
$ignore = '';
|
||||
|
|
@ -198,6 +213,12 @@ class PhpCodeSniffer implements PHPCI\Plugin, PHPCI\ZeroConfigPlugin
|
|||
return array($ignore, $standard, $suffixes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the PHPCS output report.
|
||||
* @param $output
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function processReport($output)
|
||||
{
|
||||
$data = json_decode(trim($output), true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue