Skip to content

Commit ea55683

Browse files
committed
Update coding standard
1 parent 892e441 commit ea55683

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
},
4040
"require-dev": {
4141
"ext-xdebug": "*",
42-
"aplus/coding-standard": "^1.14",
42+
"aplus/coding-standard": "^2.1",
4343
"ergebnis/composer-normalize": "^2.25",
4444
"jetbrains/phpstorm-attributes": "^1.0",
4545
"phpmd/phpmd": "^2.13",

src/CLI.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ public static function getWidth(int $default = 80) : int
371371
return $default;
372372
}
373373
$width = (int) \shell_exec('tput cols');
374-
if ( ! $width) {
374+
if (!$width) {
375375
return $default;
376376
}
377377
return $width;
@@ -509,7 +509,7 @@ public static function liveLine(string $text, bool $finalize = false) : void
509509
{
510510
// See: https://stackoverflow.com/a/35190285
511511
$string = '';
512-
if ( ! static::isWindows()) {
512+
if (!static::isWindows()) {
513513
$string .= "\33[2K";
514514
}
515515
$string .= "\r";
@@ -548,7 +548,7 @@ public static function box(
548548
) : void {
549549
$width = static::getWidth();
550550
$width -= 2;
551-
if ( ! \is_array($lines)) {
551+
if (!\is_array($lines)) {
552552
$lines = [
553553
$lines,
554554
];
@@ -669,7 +669,7 @@ public static function table(array $tbody, array $thead = []) : void
669669
// All the rows in the table will be here until the end
670670
$tableRows = [];
671671
// We need only indexes and not keys
672-
if ( ! empty($thead)) {
672+
if (!empty($thead)) {
673673
$tableRows[] = \array_values($thead);
674674
}
675675
foreach ($tbody as $tr) {
@@ -693,7 +693,7 @@ public static function table(array $tbody, array $thead = []) : void
693693
// If the current column does not have a value among the larger ones
694694
// or the value of this is greater than the existing one
695695
// then, now, this assumes the maximum length
696-
if ( ! isset($maxColsLengths[$column])
696+
if (!isset($maxColsLengths[$column])
697697
|| $allColsLengths[$row][$column] > $maxColsLengths[$column]) {
698698
$maxColsLengths[$column] = $allColsLengths[$row][$column];
699699
}
@@ -727,7 +727,7 @@ public static function table(array $tbody, array $thead = []) : void
727727
// Set the vertical borders
728728
$table .= '| ' . \implode(' | ', $value) . ' |' . \PHP_EOL;
729729
// Set the thead and table borders-bottom
730-
if (($row === 0 && ! empty($thead)) || $row + 1 === $totalRows) {
730+
if (($row === 0 && !empty($thead)) || $row + 1 === $totalRows) {
731731
$table .= $line . \PHP_EOL;
732732
}
733733
}

src/Commands/Index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ protected function getUser() : string
116116
return $this->console->getLanguage()->render('cli', 'friend');
117117
}
118118
$info = \posix_getpwnam($username);
119-
if ( ! $info) {
119+
if (!$info) {
120120
return $username;
121121
}
122122
$gecos = $info['gecos'] ?? '';
123-
if ( ! $gecos) {
123+
if (!$gecos) {
124124
return $username;
125125
}
126126
$length = \strpos($gecos, ',') ?: \strlen($gecos);

src/Console.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public function getCommands() : array
182182
{
183183
$commands = $this->commands;
184184
foreach ($commands as $name => $command) {
185-
if ( ! $command->isActive()) {
185+
if (!$command->isActive()) {
186186
unset($commands[$name]);
187187
}
188188
}
@@ -302,7 +302,7 @@ public static function commandToArgs(string $command) : array
302302
$inSQuote = false;
303303
for ($i = 0; $i < $charCount; $i++) {
304304
$char = $command[$i];
305-
if ($char === ' ' && ! $inDQuote && ! $inSQuote) {
305+
if ($char === ' ' && !$inDQuote && !$inSQuote) {
306306
if ($arg !== '') {
307307
$argv[] = $arg;
308308
}
@@ -317,11 +317,11 @@ public static function commandToArgs(string $command) : array
317317
$inDQuote = false;
318318
continue;
319319
}
320-
if ($char === '"' && ! $inSQuote) {
320+
if ($char === '"' && !$inSQuote) {
321321
$inDQuote = true;
322322
continue;
323323
}
324-
if ($char === "'" && ! $inDQuote) {
324+
if ($char === "'" && !$inDQuote) {
325325
$inSQuote = true;
326326
continue;
327327
}

0 commit comments

Comments
 (0)