Skip to content

Commit

Permalink
Move binary helper back to trait - closes #5
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenekdrahos committed Sep 14, 2015
1 parent 68e27ba commit eafc9ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
9 changes: 7 additions & 2 deletions src/CodeAnalysisTasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ trait CodeAnalysisTasks
public function tools()
{
foreach (array_keys($this->tools) as $tool) {
$this->_exec($this->options->binary("{$tool} --version"));
$this->_exec($this->binary("{$tool} --version"));
}
}

Expand Down Expand Up @@ -74,7 +74,7 @@ private function parallelRun()

private function toolToProcess($tool, $optionSeparator)
{
$binary = $this->options->binary($tool);
$binary = $this->binary($tool);
$process = $this->taskExec($binary);
foreach ($this->$tool() as $arg => $value) {
if (is_int($arg)) {
Expand Down Expand Up @@ -173,4 +173,9 @@ private function phpmetrics()
}
return $args;
}

private function binary($tool)
{
return COMPOSER_BINARY_DIR . $tool;
}
}
5 changes: 0 additions & 5 deletions src/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,4 @@ public function appFile($file)
{
return __DIR__ . "/../app/{$file}";
}

public function binary($tool)
{
return COMPOSER_BINARY_DIR . $tool;
}
}
2 changes: 0 additions & 2 deletions tests/OptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ private function overrideOptions(array $options = array())

public function testShouldEscapePaths()
{
define('COMPOSER_BINARY_DIR', __DIR__);
assertThat($this->fileOutput->analyzedDir, is('"./"'));
assertThat($this->fileOutput->toFile('file'), is('"build//file"'));
assertThat($this->fileOutput->appFile('file'), is(nonEmptyString()));
assertThat($this->fileOutput->binary('file'), is(nonEmptyString()));
}

public function testShouldIgnorePdependInCliOutput()
Expand Down

0 comments on commit eafc9ac

Please sign in to comment.