Skip to content

Commit 9c7bf0e

Browse files
authored
Use shipmonk/coding-standard (#6)
1 parent 140d16f commit 9c7bf0e

File tree

6 files changed

+30
-433
lines changed

6 files changed

+30
-433
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"phpstan/phpstan-phpunit": "^2.0.6",
2424
"phpstan/phpstan-strict-rules": "^2.0.4",
2525
"phpunit/phpunit": "^10.5.46",
26+
"shipmonk/coding-standard": "^0.1.3",
2627
"shipmonk/phpstan-rules": "^4.1.2",
2728
"slevomat/coding-standard": "^8.18.0"
2829
},

phpcs.xml.dist

Lines changed: 3 additions & 427 deletions
Large diffs are not rendered by default.

src/InlineIgnoreInliner.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ public function __construct(private Io $io)
1818

1919
/**
2020
* @param array<string, array{messages: array<array{line: ?int, identifier: ?string, ignorable: ?bool}>}> $errors
21+
*
2122
* @throws FailureException
2223
*/
2324
public function inlineErrors(
2425
array $errors,
25-
?string $comment
26+
?string $comment,
2627
): void
2728
{
2829
foreach ($errors as $filePath => $fileErrors) {

src/Io.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Io
1818

1919
/**
2020
* @param array<string> $argv
21+
*
2122
* @throws FailureException
2223
*/
2324
public function readCliComment(array $argv): ?string
@@ -66,6 +67,7 @@ public function readInput(): string
6667

6768
/**
6869
* @return list<string>
70+
*
6971
* @throws FailureException
7072
*/
7173
public function readFile(string $filePath): array
@@ -82,7 +84,10 @@ public function readFile(string $filePath): array
8284
/**
8385
* @throws FailureException
8486
*/
85-
public function writeFile(string $filePath, string $contents): void
87+
public function writeFile(
88+
string $filePath,
89+
string $contents,
90+
): void
8691
{
8792
if (file_put_contents($filePath, $contents) === false) {
8893
throw new FailureException('Could not write file ' . $filePath);

tests/InlineIgnoreInlinerTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ class InlineIgnoreInlinerTest extends TestCase
1616
{
1717

1818
#[DataProvider('lineEndingProvider')]
19-
public function testInlineErrors(string $lineEnding, ?string $comment): void
19+
public function testInlineErrors(
20+
string $lineEnding,
21+
?string $comment,
22+
): void
2023
{
2124
$tmpFilePath = sys_get_temp_dir() . '/' . uniqid('ignore', true) . '.php';
2225
$tmpExpectedPath = sys_get_temp_dir() . '/' . uniqid('ignore-expected', true) . '.php';
@@ -52,7 +55,10 @@ public function testInlineErrors(string $lineEnding, ?string $comment): void
5255
self::assertFileEquals($tmpExpectedPath, $tmpFilePath);
5356
}
5457

55-
private function getTestFileContent(string $filename, string $lineEnding): string
58+
private function getTestFileContent(
59+
string $filename,
60+
string $lineEnding,
61+
): string
5662
{
5763
$content = file_get_contents(__DIR__ . '/data/' . $filename);
5864
self::assertNotFalse($content);

tests/IoTest.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ class IoTest extends TestCase
1919
* @param list<string> $args
2020
*/
2121
#[DataProvider('optionsProvider')]
22-
public function testValidCliOptions(int $exitCode, string $input, array $args, string $expectedOutput): void
22+
public function testValidCliOptions(
23+
int $exitCode,
24+
string $input,
25+
array $args,
26+
string $expectedOutput,
27+
): void
2328
{
2429
$result = $this->runCliCommand($args, $input);
2530
self::assertSame($exitCode, $result['exitCode']);
@@ -51,7 +56,10 @@ public static function optionsProvider(): array
5156
* @param list<string> $args
5257
* @return array{exitCode: int, stdout: string, stderr: string}
5358
*/
54-
private function runCliCommand(array $args, string $input): array
59+
private function runCliCommand(
60+
array $args,
61+
string $input,
62+
): array
5563
{
5664
$binaryPath = __DIR__ . '/../bin/inline-phpstan-ignores';
5765
$command = ['php', $binaryPath, ...$args];

0 commit comments

Comments
 (0)