diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 90eb2f80..6b50ea38 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -15,16 +15,6 @@ parameters: count: 1 path: src/Rules.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:createStub\\(\\)\\.$#" - count: 3 - path: test/Unit/FactoryTest.php - - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:createStub\\(\\)\\.$#" - count: 16 - path: test/Unit/FixersTest.php - - message: "#^Parameter \\#1 \\$iterable of static method Ergebnis\\\\PhpCsFixer\\\\Config\\\\Fixers\\:\\:fromIterable\\(\\) expects iterable\\, array\\ given\\.$#" count: 1 @@ -40,8 +30,3 @@ parameters: count: 1 path: test/Unit/RuleSet/AbstractRuleSetTestCase.php - - - message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\TestCase\\:\\:createStub\\(\\)\\.$#" - count: 14 - path: test/Unit/RuleSetTest.php - diff --git a/test/Unit/FactoryTest.php b/test/Unit/FactoryTest.php index 8b383aed..9f2b104f 100644 --- a/test/Unit/FactoryTest.php +++ b/test/Unit/FactoryTest.php @@ -66,9 +66,9 @@ public function testFromRuleSetThrowsRuntimeExceptionWhenCurrentPhpVersionIsLess public function testFromRuleSetCreatesConfigWhenCurrentPhpVersionIsEqualToOrGreaterThanTargetPhpVersion(PhpVersion $targetPhpVersion): void { $customFixers = Fixers::fromFixers( - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), ); $rules = Rules::fromArray([ diff --git a/test/Unit/FixersTest.php b/test/Unit/FixersTest.php index de710dc4..2a0f0efe 100644 --- a/test/Unit/FixersTest.php +++ b/test/Unit/FixersTest.php @@ -30,9 +30,9 @@ public function testEmptyReturnsFixers(): void public function testFromFixersReturnsFixers(): void { $value = [ - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), ]; $fixers = Fixers::fromFixers(...$value); @@ -43,9 +43,9 @@ public function testFromFixersReturnsFixers(): void public function testFromIterableRejectsInvalidValue(): void { $value = [ - $this->createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), new \stdClass(), - $this->createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), ]; $this->expectException(\InvalidArgumentException::class); @@ -63,9 +63,9 @@ public function testFromIterableRejectsInvalidValue(): void public function testFromIterableReturnsFixersWhenValueIsArray(): void { $value = [ - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), ]; $fixers = Fixers::fromIterable($value); @@ -76,9 +76,9 @@ public function testFromIterableReturnsFixersWhenValueIsArray(): void public function testFromIterableReturnsFixersWhenValueIsTraversable(): void { $value = [ - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), ]; $iterable = new \ArrayIterator($value); @@ -91,14 +91,14 @@ public function testFromIterableReturnsFixersWhenValueIsTraversable(): void public function testMergeReturnsFixersMergedWithFixers(): void { $one = Fixers::fromFixers( - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), ); $two = Fixers::fromFixers( - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), ); $mutated = $one->merge($two); diff --git a/test/Unit/RuleSetTest.php b/test/Unit/RuleSetTest.php index 549f44eb..37b398ca 100644 --- a/test/Unit/RuleSetTest.php +++ b/test/Unit/RuleSetTest.php @@ -39,9 +39,9 @@ public function testCreateReturnsRuleSet(): void $faker = self::faker(); $customFixers = Fixers::fromFixers( - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), ); $name = Name::fromString($faker->word()); $phpVersion = PhpVersion::create( @@ -71,15 +71,15 @@ public function testWithCustomFixersReturnsRuleSetWithMergedCustomFixers(): void $faker = self::faker(); $customFixers = Fixers::fromFixers( - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), ); $ruleSet = RuleSet::create( Fixers::fromFixers( - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), ), Name::fromString($faker->word()), PhpVersion::create( @@ -116,9 +116,9 @@ public function testWithRulesReturnsRuleSetWithMergedRules(): void $ruleSet = RuleSet::create( Fixers::fromFixers( - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), ), Name::fromString($faker->word()), PhpVersion::create( @@ -152,9 +152,9 @@ public function testWithHeaderReturnsRuleSetWithEnabledHeaderCommentFixer(string $ruleSet = RuleSet::create( Fixers::fromFixers( - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), - $this->createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), + self::createStub(Fixer\FixerInterface::class), ), Name::fromString($faker->word()), PhpVersion::create(