Skip to content

Commit

Permalink
Fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Jan 15, 2025
1 parent 3e29e44 commit 7cbc10d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions tests/Cache/Manager/FileCacheManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class FileCacheManagerTest extends TestCase
public function testNeedFixing(): void
{
$cacheManager = new FileCacheManager(
self::createStub(CacheFileHandlerInterface::class),
static::createStub(CacheFileHandlerInterface::class),
new Signature('8.0', '1', [])
);

Expand All @@ -36,7 +36,7 @@ public function testNeedFixingWithCache(): void
$cache = new Cache($signature);
$cache->set($file, md5($content));

$cacheFileHandler = self::createStub(CacheFileHandlerInterface::class);
$cacheFileHandler = static::createStub(CacheFileHandlerInterface::class);
$cacheFileHandler->method('read')->willReturn($cache);

$cacheManager = new FileCacheManager($cacheFileHandler, $signature);
Expand All @@ -57,7 +57,7 @@ public function testNeedFixingWithOutdatedCache(): void
$cache = new Cache(new Signature('8.0', '1', []));
$cache->set($file, md5($content));

$cacheFileHandler = self::createStub(CacheFileHandlerInterface::class);
$cacheFileHandler = static::createStub(CacheFileHandlerInterface::class);
$cacheFileHandler->method('read')->willReturn($cache);

$cacheManager = new FileCacheManager(
Expand All @@ -83,7 +83,7 @@ public function testDestructWriteCache(): void
public function testCannotSerialize(): void
{
$cacheManager = new FileCacheManager(
self::createStub(CacheFileHandlerInterface::class),
static::createStub(CacheFileHandlerInterface::class),
new Signature('8.0', '1', [])
);

Expand Down
2 changes: 1 addition & 1 deletion tests/Cache/SignatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testSignatureFromRuleset(): void
{
$ruleset = new Ruleset();

$rule = self::createStub(RuleInterface::class);
$rule = static::createStub(RuleInterface::class);
$ruleset->addRule($rule);

$configurableRule = new class extends AbstractRule implements ConfigurableRuleInterface {
Expand Down
6 changes: 3 additions & 3 deletions tests/Ruleset/RulesetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ public function testAddStandard(): void
$rule1 = new SingleQuoteRule(true);
$rule2 = new SingleQuoteRule(false);

$standard1 = self::createStub(StandardInterface::class);
$standard1 = static::createStub(StandardInterface::class);
$standard1->method('getRules')->willReturn([$rule1]);

$standard2 = self::createStub(StandardInterface::class);
$standard2 = static::createStub(StandardInterface::class);
$standard2->method('getRules')->willReturn([$rule2]);

$ruleset->addStandard($standard1);
Expand All @@ -81,7 +81,7 @@ protected function process(int $tokenIndex, Tokens $tokens): void
{
}
};
$standard = self::createStub(StandardInterface::class);
$standard = static::createStub(StandardInterface::class);
$standard->method('getRules')->willReturn([$rule1, $rule2]);

$ruleset->addStandard($standard);
Expand Down
2 changes: 1 addition & 1 deletion tests/Runner/FixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function testInvalidFile(): void
{
$exception = CannotTokenizeException::unknownError();

$tokenizer = self::createStub(TokenizerInterface::class);
$tokenizer = static::createStub(TokenizerInterface::class);
$tokenizer->method('tokenize')->willThrowException($exception);
$ruleset = new Ruleset();

Expand Down
10 changes: 5 additions & 5 deletions tests/Runner/LinterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function testUntokenizableFilesAreReported(): void
$filePath2 = $this->getTmpPath(__DIR__.'/Fixtures/Linter/file2.twig');

$env = new StubbedEnvironment();
$tokenizer = self::createStub(TokenizerInterface::class);
$tokenizer = static::createStub(TokenizerInterface::class);

$call = 0;
$tokenizer->method('tokenize')->willReturnCallback(
Expand Down Expand Up @@ -118,7 +118,7 @@ public function testUserDeprecationAreReported(): void
$filePath = $this->getTmpPath(__DIR__.'/Fixtures/Linter/file.twig');

$env = new StubbedEnvironment();
$tokenizer = self::createStub(TokenizerInterface::class);
$tokenizer = static::createStub(TokenizerInterface::class);
$tokenizer->method('tokenize')->willReturnCallback(static function (): Tokens {
@trigger_error('Default');
trigger_error('User Deprecation', \E_USER_DEPRECATED);
Expand Down Expand Up @@ -176,7 +176,7 @@ public function testBuggyFixesAreReported(
$ruleset = new Ruleset();

$call = 0;
$fixer = self::createStub(FixerInterface::class);
$fixer = static::createStub(FixerInterface::class);
$fixer->method('fixFile')->willReturnCallback(
static function () use (&$call, $exception): string {
/** @psalm-suppress RedundantCondition https://github.com/vimeo/psalm/issues/10513 */
Expand Down Expand Up @@ -329,9 +329,9 @@ public function testNodeVisitorWithInvalidFiles(): void
$ruleset->addRule(new ForbiddenBlockRule(['trans']));
$ruleset->addRule(new ForbiddenFunctionRule(['t']));

$env = self::createStub(Environment::class);
$env = static::createStub(Environment::class);
$env->method('tokenize')->willThrowException(new SyntaxError('Error.'));
$tokenizer = self::createStub(TokenizerInterface::class);
$tokenizer = static::createStub(TokenizerInterface::class);
$tokenizer->method('tokenize')->willReturn(new Tokens());

$linter = new Linter($env, $tokenizer);
Expand Down

0 comments on commit 7cbc10d

Please sign in to comment.