Skip to content

Commit

Permalink
Tools - fix dev-master dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenekdrahos committed Dec 23, 2016
1 parent 599db49 commit 1d36cc1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Task/ToolVersions.php
Original file line number Diff line number Diff line change
@@ -66,6 +66,7 @@ private function toolToTableRow($tool, $composerPackage, array $composerPackages
$composerInfo = array_key_exists($composerPackage, $composerPackages) ?
get_object_vars($composerPackages[$composerPackage]) :
[
'version' => '',
'version_normalized' => '<error>not installed</error>',
'authors' => [(object) ['name' => "<info>composer require {$composerPackage}</info>"]],
];
@@ -76,14 +77,17 @@ private function toolToTableRow($tool, $composerPackage, array $composerPackages

return array(
"<comment>{$tool}</comment>",
$this->stripTrailingZeroVersion($composerInfo['version_normalized']),
$this->normalizeVersion($composerInfo),
$this->groupAuthors($composerInfo['authors'])
);
}

private function stripTrailingZeroVersion($version)
private function normalizeVersion(array $composerInfo)
{
return preg_replace('/\.0$/s', '', $version);
if ($composerInfo['version_normalized'] == '9999999-dev') {
return $composerInfo['version'];
}
return preg_replace('/\.0$/s', '', $composerInfo['version_normalized']);
}

private function groupAuthors(array $composerAuthors)

0 comments on commit 1d36cc1

Please sign in to comment.