Fixed PHPDockblockChecker for PHP 7.2. Issue #170.
This commit is contained in:
parent
0ad9bd836e
commit
3cebeb784e
|
@ -134,11 +134,16 @@ class PhpDocblockChecker extends Plugin implements ZeroConfigPluginInterface
|
|||
$this->builder->logExecOutput(true);
|
||||
|
||||
$output = json_decode($this->builder->getLastOutput(), true);
|
||||
$errors = count($output);
|
||||
$success = true;
|
||||
|
||||
$this->build->storeMeta('phpdoccheck-warnings', $errors);
|
||||
$errors = 0;
|
||||
if ($output && is_array($output)) {
|
||||
$errors = count($output);
|
||||
|
||||
$this->reportErrors($output);
|
||||
}
|
||||
$this->build->storeMeta('phpdoccheck-warnings', $errors);
|
||||
|
||||
$success = true;
|
||||
|
||||
if ($this->allowedWarnings != -1 && $errors > $this->allowedWarnings) {
|
||||
$success = false;
|
||||
|
@ -151,7 +156,7 @@ class PhpDocblockChecker extends Plugin implements ZeroConfigPluginInterface
|
|||
* Report all of the errors we've encountered line-by-line.
|
||||
* @param array $output
|
||||
*/
|
||||
protected function reportErrors($output)
|
||||
protected function reportErrors(array $output)
|
||||
{
|
||||
foreach ($output as $error) {
|
||||
switch ($error['type']) {
|
||||
|
|
Loading…
Reference in a new issue