Skip to content
This repository was archived by the owner on Feb 15, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion PHPCI/Plugin/PhpParallelLint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'];
Expand All @@ -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]*$/';
Expand All @@ -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
);
Expand Down