Skip to content

Commit f5058f9

Browse files
committed
chore: Refactor code formatting in Clean.php, PintInputInterface.php, CustomOrderedClassElementsFixer.php, PintConfigurationJsonRepository.php, Tool.php, and UserScript.php
1 parent 23a2faa commit f5058f9

File tree

6 files changed

+14
-15
lines changed

6 files changed

+14
-15
lines changed

app/Actions/Clean.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ class Clean
1313
public function __construct(
1414
protected string $mode,
1515
protected array $tools,
16-
) {
17-
}
16+
) {}
1817

1918
public function execute(): int
2019
{

app/Contracts/PintInputInterface.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44

55
use Symfony\Component\Console\Input\InputInterface;
66

7-
interface PintInputInterface extends InputInterface
8-
{
9-
}
7+
interface PintInputInterface extends InputInterface {}

app/Fixer/ClassNotation/CustomOrderedClassElementsFixer.php

+9-4
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,10 @@ static function (array $values) use ($builtIns): bool {
383383
'method_private',
384384
])
385385
->getOption(),
386-
(new FixerOptionBuilder('sort_algorithm', 'How multiple occurrences of same type statements should be sorted.'))
386+
(new FixerOptionBuilder(
387+
'sort_algorithm',
388+
'How multiple occurrences of same type statements should be sorted.'
389+
))
387390
->setAllowedValues(self::SUPPORTED_SORT_ALGORITHMS)
388391
->setDefault(self::SORT_NONE)
389392
->getOption(),
@@ -540,7 +543,7 @@ private function findElementEnd(Tokens $tokens, int $index): int
540543
$index = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $index);
541544
}
542545

543-
for (++$index; $tokens[$index]->isWhitespace(" \t") || $tokens[$index]->isComment(); $index++);
546+
for (++$index; $tokens[$index]->isWhitespace(" \t") || $tokens[$index]->isComment(); $index++); // @codingStandardsIgnoreLine
544547

545548
$index--;
546549

@@ -569,7 +572,9 @@ private function sortElements(array $elements): array
569572
$getPositionType = function (array $element) use ($phpunitPositions): int {
570573
$type = $element['type'];
571574

572-
if (in_array($type, ['method', 'magic', 'phpunit'], true) && isset($this->typePosition["method:{$element['name']}"])) {
575+
if (in_array($type, ['method', 'magic', 'phpunit'], true) &&
576+
isset($this->typePosition["method:{$element['name']}"])
577+
) {
573578
return $this->typePosition["method:{$element['name']}"];
574579
}
575580

@@ -617,7 +622,7 @@ private function sortElements(array $elements): array
617622
* @param array{element: _ClassElement, position: int} $b
618623
* @return -1|0|1
619624
*/
620-
fn (array $a, array $b): int => ($a['position'] === $b['position']) ? $this->sortGroupElements($a['element'], $b['element']) : $a['position'] <=> $b['position'],
625+
fn (array $a, array $b): int => ($a['position'] === $b['position']) ? $this->sortGroupElements($a['element'], $b['element']) : $a['position'] <=> $b['position'], // @codingStandardsIgnoreLine
621626
);
622627
}
623628

app/Repositories/PintConfigurationJsonRepository.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ public function __construct(
1111
protected $path,
1212
protected $preset,
1313
protected array $exclude
14-
) {
15-
}
14+
) {}
1615

1716
/**
1817
* @return array<string, array<int, string>|string>

app/Support/Tool.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ abstract class Tool
88
{
99
public function __construct(
1010
protected ReviveConfig $reviveConfig,
11-
) {
12-
}
11+
) {}
1312

1413
abstract public function lint(): int;
1514

app/Support/UserScript.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ public function __construct(
1515
protected string $name,
1616
protected array $command,
1717
protected ReviveConfig $reviveConfig,
18-
) {
19-
}
18+
) {}
2019

2120
public function lint(): int
2221
{

0 commit comments

Comments
 (0)