diff --git a/PHPCI/Plugin/PhpParallelLint.php b/PHPCI/Plugin/PhpParallelLint.php index fa072a8d5..420e06ed9 100644 --- a/PHPCI/Plugin/PhpParallelLint.php +++ b/PHPCI/Plugin/PhpParallelLint.php @@ -46,12 +46,18 @@ class PhpParallelLint implements \PHPCI\Plugin */ protected $extensions; + /** + * @var bool - enable short tags + */ + protected $shortTag; + /** * Standard Constructor * * $options['directory'] Output Directory. Default: %BUILDPATH% * $options['filename'] Phar Filename. Default: build.phar * $options['extensions'] Filename extensions. Default: php + * $options['shorttags'] Enable short tags. Default: false * $options['stub'] Stub Content. No Default Value * * @param Builder $phpci @@ -65,6 +71,7 @@ public function __construct(Builder $phpci, Build $build, array $options = array $this->directory = $phpci->buildPath; $this->ignore = $this->phpci->ignore; $this->extensions = 'php'; + $this->shortTag = false; if (isset($options['directory'])) { $this->directory = $phpci->buildPath.$options['directory']; @@ -74,6 +81,10 @@ public function __construct(Builder $phpci, Build $build, array $options = array $this->ignore = $options['ignore']; } + if (isset($options['shorttags'])) { + $this->shortTag = (strtolower($options['shorttags']) == 'true'); + } + if (isset($options['extensions'])) { // Only use if this is a comma delimited list $pattern = '/^[a-z]*,\ *[a-z]*$/'; @@ -93,10 +104,11 @@ public function execute() $phplint = $this->phpci->findBinary('parallel-lint'); - $cmd = $phplint . ' -e %s' . ' %s "%s"'; + $cmd = $phplint . ' -e %s' . '%s %s "%s"'; $success = $this->phpci->executeCommand( $cmd, $this->extensions, + ($this->shortTag ? ' -s' : ''), $ignore, $this->directory );