Skip to content

Commit

Permalink
style: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
shvlv committed Mar 7, 2024
1 parent a6116b7 commit 5ef5fa7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<file>./Inpsyde/Sniffs</file>
<file>./tests/src</file>
<file>./tests/cases</file>
<file>./tests/e2e/E2eTest.php</file>

<!--
PHP 7.4 and higher.
Expand Down
11 changes: 8 additions & 3 deletions tests/e2e/E2eTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ protected function setUp(): void
public function testInpsydeAndTemplatesRulesets(): void
{
$output = [];
// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.system_calls_exec
exec(
sprintf(
'cd %s && %s',
Expand All @@ -37,7 +38,8 @@ public function testInpsydeAndTemplatesRulesets(): void

$json = end($output);

self::assertSame([
// phpcs:disable Inpsyde.CodeQuality.LineLength.TooLong
$expectedMessages = [
'index.php' => [
[
'source' => 'Inpsyde.CodeQuality.NoElse.ElseFound',
Expand All @@ -64,13 +66,16 @@ public function testInpsydeAndTemplatesRulesets(): void
],

],
], $this->phpCsNormalizedOutput($json));
];
// phpcs:enable Inpsyde.CodeQuality.LineLength.TooLong

self::assertSame($expectedMessages, $this->phpCsMessages($json));
}

/**
* @psalm-return array<string, list<array{source: string, line: positive-int}>>
*/
private function phpCsNormalizedOutput(string $json): array
private function phpCsMessages(string $json): array
{
/** @var array{
* files: array<string, array{
Expand Down

0 comments on commit 5ef5fa7

Please sign in to comment.