From acf4d093bbd1715b1e3aa020089502e27a9d6594 Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Wed, 16 Apr 2014 12:30:03 +0100 Subject: [PATCH] Updating PHPMD to enforce rules being an array. Fixes #319 --- PHPCI/Plugin/PhpMessDetector.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PHPCI/Plugin/PhpMessDetector.php b/PHPCI/Plugin/PhpMessDetector.php index c5e56e4e..06bc72e8 100755 --- a/PHPCI/Plugin/PhpMessDetector.php +++ b/PHPCI/Plugin/PhpMessDetector.php @@ -86,6 +86,11 @@ class PhpMessDetector implements \PHPCI\Plugin $suffixes = ' --suffixes ' . implode(',', $this->suffixes); } + if (!empty($this->rules) && !is_array($this->rules)) { + $this->phpci->logFailure('The "rules" option must be an array.'); + return false; + } + foreach ($this->rules as &$rule) { if (strpos($rule, '/') !== false) { $rule = $this->phpci->buildPath . $rule;