Skip to content

Commit 28e860e

Browse files
committed
cs
1 parent fec7cba commit 28e860e

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/Matrix/Command/MatrixCommand.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ private function createTableRows(array $requiredPackageNames, RepositoryCollecti
8686
{
8787
$requiredPackageNames = $this->packageSorter->sort($requiredPackageNames);
8888

89-
$dependencyCountRow = $this->createDependencyCountRow($repositoryCollection);
90-
$tableRows = [$dependencyCountRow];
89+
$tableRows = [];
90+
$tableRows[] = $this->createDependencyCountRow($repositoryCollection);
9191

9292
$repositoryCount = $repositoryCollection->count();
9393

@@ -101,7 +101,7 @@ private function createTableRows(array $requiredPackageNames, RepositoryCollecti
101101
++$knownValuesCount;
102102
}
103103

104-
if ($this->isUnknownPhp($requiredPackageName, $packageVersion)) {
104+
if ($this->isPhpUnknown($requiredPackageName, $packageVersion)) {
105105
$dataRow[] = new TableCell(self::MISSING_LABEL, null, Color::RED);
106106
} else {
107107
$dataRow[] = $packageVersion;
@@ -134,18 +134,15 @@ private function createTableRows(array $requiredPackageNames, RepositoryCollecti
134134
*/
135135
private function renderTable(array $tableHeadlines, array $tableRows): void
136136
{
137-
// create array of "right", in the same count as count of $tableHeadlines
138-
$alligns = array_fill(0, count($tableHeadlines), ColumnAlign::RIGHT);
139-
140137
// allign first column to left
141-
array_unshift($alligns, ColumnAlign::LEFT);
138+
// create array of "right", in the same count as count of $tableHeadlines
139+
$alligns = array_merge([ColumnAlign::LEFT], array_fill(0, count($tableHeadlines), ColumnAlign::RIGHT));
142140

143141
$consoleTable = new ConsoleTable($tableHeadlines, $tableRows, $alligns);
144-
145142
$this->outputPrinter->writeln($consoleTable->render());
146143
}
147144

148-
private function isUnknownPhp(string $packageName, ?string $packageVersion): bool
145+
private function isPhpUnknown(string $packageName, ?string $packageVersion): bool
149146
{
150147
if ($packageName !== 'php') {
151148
return false;

0 commit comments

Comments
 (0)