From 644b5cacb32fd0c0bed35070beb30d1e0d6b2f2d Mon Sep 17 00:00:00 2001 From: Valeriy Tropin Date: Wed, 15 Mar 2017 12:46:08 +0200 Subject: [PATCH] - allow override ignore, standard - fix plugin behaviour according to documentation --- src/PHPCensor/Plugin/PhpCodeSniffer.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/PHPCensor/Plugin/PhpCodeSniffer.php b/src/PHPCensor/Plugin/PhpCodeSniffer.php index b14506c2..458d91a4 100644 --- a/src/PHPCensor/Plugin/PhpCodeSniffer.php +++ b/src/PHPCensor/Plugin/PhpCodeSniffer.php @@ -92,6 +92,14 @@ class PhpCodeSniffer extends Plugin implements ZeroConfigPluginInterface $this->allowed_errors = -1; } + if (!empty($options['allowed_errors']) && is_int($options['allowed_errors'])) { + $this->allowed_warnings = $options['allowed_errors']; + } + + if (!empty($options['allowed_warnings']) && is_int($options['allowed_warnings'])) { + $this->allowed_warnings = $options['allowed_warnings']; + } + if (isset($options['suffixes'])) { $this->suffixes = (array)$options['suffixes']; } @@ -103,6 +111,14 @@ class PhpCodeSniffer extends Plugin implements ZeroConfigPluginInterface if (!empty($options['encoding'])) { $this->encoding = ' --encoding=' . $options['encoding']; } + + if (!empty($options['ignore'])) { + $this->ignore = (array)$options['ignore']; + } + + if (!empty($options['standard'])) { + $this->standard = (array)$options['standard']; + } } /**