Skip to content

Commit

Permalink
Fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Aug 13, 2024
1 parent bfb0abd commit 90c53b4
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 26 deletions.
14 changes: 7 additions & 7 deletions tests/Binary/Fixtures/.twig-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,27 @@
use TwigCsFixer\Standard\StandardInterface;
use TwigCsFixer\Token\Tokens;

$rule = new class() extends AbstractRule {
$rule = new class extends AbstractRule {
protected function process(int $tokenIndex, Tokens $tokens): void
{
}
};

$nodeRule = new class() extends AbstractNodeRule {
$nodeRule = new class extends AbstractNodeRule {
public function enterNode(Node $node, Environment $env): Node
{
return $node;
}
};

$standard = new class() implements StandardInterface {
$standard = new class implements StandardInterface {
public function getRules(): array
{
return [];
}
};

$reporter = new class() implements ReporterInterface {
$reporter = new class implements ReporterInterface {
public function display(
OutputInterface $output,
Report $report,
Expand All @@ -55,7 +55,7 @@ public function getName(): string
}
};

$twigExtension = new class() implements ExtensionInterface {
$twigExtension = new class implements ExtensionInterface {
public function getTokenParsers(): array
{
return [];
Expand Down Expand Up @@ -87,7 +87,7 @@ public function getOperators(): array
}
};

$tokenParser = new class() implements TokenParserInterface {
$tokenParser = new class implements TokenParserInterface {
public function setParser(Parser $parser): void
{
}
Expand All @@ -103,7 +103,7 @@ public function getTag(): string
}
};

$nodeVisitor = new class() implements NodeVisitorInterface {
$nodeVisitor = new class implements NodeVisitorInterface {
public function enterNode(Node $node, Environment $env): Node
{
return $node;
Expand Down
2 changes: 1 addition & 1 deletion tests/Cache/SignatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testSignatureFromRuleset(): void
$rule = self::createStub(RuleInterface::class);
$ruleset->addRule($rule);

$configurableRule = new class() extends AbstractRule implements ConfigurableRuleInterface {
$configurableRule = new class extends AbstractRule implements ConfigurableRuleInterface {
public function getConfiguration(): array
{
return ['a' => 1];
Expand Down
2 changes: 1 addition & 1 deletion tests/Environment/StubbedEnvironmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public function testParseWithCustomNodeVisitor(): void
$content = file_get_contents(__DIR__.'/Fixtures/node_visitor.html.twig');
static::assertNotFalse($content);

$visitor = new class() implements NodeVisitorInterface {
$visitor = new class implements NodeVisitorInterface {
public int $called = 0;

public function enterNode(Node $node, Environment $env): Node
Expand Down
2 changes: 1 addition & 1 deletion tests/Report/ReporterFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testGetUnsupporterReporter(): void

public function testGetCustomReporter(): void
{
$fooReporter = new class() implements ReporterInterface {
$fooReporter = new class implements ReporterInterface {
public function getName(): string
{
return 'foo';
Expand Down
6 changes: 3 additions & 3 deletions tests/Rules/Node/NodeRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function testEnterNodeRule(): void
{
$report = new Report([new \SplFileInfo('fakeFile.html.twig')]);

$rule = new class() extends AbstractNodeRule {
$rule = new class extends AbstractNodeRule {
public function enterNode(Node $node, Environment $env): Node
{
$this->addWarning('Fake Warning', $node);
Expand All @@ -50,7 +50,7 @@ public function testLeaveNodeRule(): void
{
$report = new Report([new \SplFileInfo('fakeFile.html.twig')]);

$rule = new class() extends AbstractNodeRule {
$rule = new class extends AbstractNodeRule {
public function leaveNode(Node $node, Environment $env): Node
{
$this->addWarning('Fake Warning', $node);
Expand Down Expand Up @@ -81,7 +81,7 @@ public function testRuleName(): void

public function testNodeVisitorPriority(): void
{
$rule = new class() extends AbstractNodeRule {};
$rule = new class extends AbstractNodeRule {};
static::assertSame(0, $rule->getPriority());
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Rules/RuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function testRuleWithReport(): void
{
$report = new Report([new \SplFileInfo('fakeFile.html.twig')]);

$rule = new class() extends AbstractFixableRule {
$rule = new class extends AbstractFixableRule {
protected function process(int $tokenIndex, Tokens $tokens): void
{
$token = $tokens->get($tokenIndex);
Expand Down Expand Up @@ -55,7 +55,7 @@ public function testRuleWithReport2(): void
{
$report = new Report([new \SplFileInfo('fakeFile.html.twig')]);

$rule = new class() extends AbstractFixableRule {
$rule = new class extends AbstractFixableRule {
protected function process(int $tokenIndex, Tokens $tokens): void
{
$token = $tokens->get($tokenIndex);
Expand Down
2 changes: 1 addition & 1 deletion tests/Rules/SpacingRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class SpacingRuleTest extends TestCase
{
public function testSpacingRule(): void
{
$rule = new class() extends AbstractSpacingRule {
$rule = new class extends AbstractSpacingRule {
protected function getSpaceBefore(int $tokenIndex, Tokens $tokens): ?int
{
$token = $tokens->get($tokenIndex);
Expand Down
4 changes: 2 additions & 2 deletions tests/Ruleset/RulesetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ public function testAllowNonFixableRules(): void
{
$ruleset = new Ruleset();

$rule1 = new class() extends AbstractRule {
$rule1 = new class extends AbstractRule {
protected function process(int $tokenIndex, Tokens $tokens): void
{
}
};
$rule2 = new class() extends AbstractFixableRule {
$rule2 = new class extends AbstractFixableRule {
protected function process(int $tokenIndex, Tokens $tokens): void
{
}
Expand Down
16 changes: 8 additions & 8 deletions tests/Runner/FixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function testReplaceToken(): void
{
$tokenizer = new Tokenizer(new StubbedEnvironment());

$rule = new class() extends AbstractFixableRule {
$rule = new class extends AbstractFixableRule {
private bool $isAlreadyExecuted = false;

protected function process(int $tokenIndex, Tokens $tokens): void
Expand Down Expand Up @@ -97,7 +97,7 @@ public function testReplaceTokenIsDesignedAgainstInfiniteLoop(): void
{
$tokenizer = new Tokenizer(new StubbedEnvironment());

$rule = new class() extends AbstractFixableRule {
$rule = new class extends AbstractFixableRule {
protected function process(int $tokenIndex, Tokens $tokens): void
{
$fixer = $this->addFixableError('Error', $tokens->get($tokenIndex));
Expand All @@ -122,7 +122,7 @@ public function testReplaceTokenIsDesignedAgainstConflict(): void
{
$tokenizer = new Tokenizer(new StubbedEnvironment());

$rule1 = new class() extends AbstractFixableRule {
$rule1 = new class extends AbstractFixableRule {
private bool $isAlreadyExecuted = false;

protected function process(int $tokenIndex, Tokens $tokens): void
Expand All @@ -140,7 +140,7 @@ protected function process(int $tokenIndex, Tokens $tokens): void
$fixer->replaceToken($tokenIndex, 'rule');
}
};
$rule2 = new class() extends AbstractFixableRule {
$rule2 = new class extends AbstractFixableRule {
private int $error = 0;

protected function process(int $tokenIndex, Tokens $tokens): void
Expand Down Expand Up @@ -172,7 +172,7 @@ protected function process(int $tokenIndex, Tokens $tokens): void
$fixer->endChangeSet();
}
};
$rule3 = new class() extends AbstractFixableRule {
$rule3 = new class extends AbstractFixableRule {
private bool $isAlreadyExecuted = false;

protected function process(int $tokenIndex, Tokens $tokens): void
Expand Down Expand Up @@ -210,7 +210,7 @@ public function testIgnoredViolations(): void
{
$tokenizer = new Tokenizer(new StubbedEnvironment());

$rule = new class() extends AbstractFixableRule {
$rule = new class extends AbstractFixableRule {
public function getShortName(): string
{
return 'Rule';
Expand Down Expand Up @@ -247,7 +247,7 @@ public function testAddContentMethods(string $content, string $expected): void
{
$tokenizer = new Tokenizer(new StubbedEnvironment());

$rule = new class() extends AbstractFixableRule {
$rule = new class extends AbstractFixableRule {
private bool $isAlreadyExecuted = false;

protected function process(int $tokenIndex, Tokens $tokens): void
Expand Down Expand Up @@ -313,7 +313,7 @@ public function testNonFixableRulesAreSkipped(): void
{
$tokenizer = new Tokenizer(new StubbedEnvironment());

$rule = new class() extends AbstractRule {
$rule = new class extends AbstractRule {
protected function process(int $tokenIndex, Tokens $tokens): void
{
throw new \LogicException('Should be skipped');
Expand Down

0 comments on commit 90c53b4

Please sign in to comment.