diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 0db8a45f..bf9900a4 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,9 +1,10 @@ - - \Generator - + + $rules + $rules + @@ -16,10 +17,6 @@ getFixers registerBuiltInFixers - - \Generator - \Generator - getRules diff --git a/src/Factory.php b/src/Factory.php index 07afb4a3..c4b239db 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -20,6 +20,8 @@ final class Factory /** * Creates a configuration based on a rule set. * + * @param array $overrideRules + * * @throws \RuntimeException */ public static function fromRuleSet(RuleSet $ruleSet, array $overrideRules = []): Config diff --git a/src/RuleSet.php b/src/RuleSet.php index dc4ffd1a..ff99413e 100644 --- a/src/RuleSet.php +++ b/src/RuleSet.php @@ -22,6 +22,8 @@ public function name(): string; /** * Returns an array of rules along with their configuration. + * + * @return array */ public function rules(): array; diff --git a/src/RuleSet/AbstractRuleSet.php b/src/RuleSet/AbstractRuleSet.php index 3810d9d7..fb2b2110 100644 --- a/src/RuleSet/AbstractRuleSet.php +++ b/src/RuleSet/AbstractRuleSet.php @@ -26,7 +26,7 @@ abstract class AbstractRuleSet implements RuleSet protected $name = ''; /** - * @var array + * @var array */ protected $rules = []; diff --git a/test/Unit/FactoryTest.php b/test/Unit/FactoryTest.php index 1196e6db..50d568d0 100644 --- a/test/Unit/FactoryTest.php +++ b/test/Unit/FactoryTest.php @@ -85,7 +85,7 @@ public function testFromRuleSetCreatesConfig(int $targetPhpVersion): void private $name; /** - * @var array + * @var array */ private $rules; @@ -124,6 +124,9 @@ public function targetPhpVersion(): int self::assertSame($rules, $config->getRules()); } + /** + * @return \Generator + */ public function provideTargetPhpVersion(): \Generator { $values = [ @@ -158,7 +161,7 @@ public function testFromRuleSetCreatesConfigWithOverrideRules(): void private $name; /** - * @var array + * @var array */ private $rules; diff --git a/test/Unit/RuleSet/AbstractRuleSetTestCase.php b/test/Unit/RuleSet/AbstractRuleSetTestCase.php index 92c670f4..6b51dccc 100644 --- a/test/Unit/RuleSet/AbstractRuleSetTestCase.php +++ b/test/Unit/RuleSet/AbstractRuleSetTestCase.php @@ -105,6 +105,9 @@ final public function testHeaderCommentFixerIsEnabledIfHeaderIsProvided(string $ self::assertSame($expected, $rules['header_comment']); } + /** + * @return \Generator + */ final public function provideValidHeader(): \Generator { $values = [ @@ -124,8 +127,6 @@ final public function provideValidHeader(): \Generator /** * @dataProvider provideSourceAndRuleNames - * - * @param string[] $ruleNames */ final public function testRulesAreSortedByName(string $source, array $ruleNames): void { @@ -141,8 +142,6 @@ final public function testRulesAreSortedByName(string $source, array $ruleNames) /** * @dataProvider provideSourceAndRuleNames - * - * @param string[] $ruleNames */ final public function testRulesDoNotContainRuleSets(string $source, array $ruleNames): void { @@ -157,6 +156,13 @@ final public function testRulesDoNotContainRuleSets(string $source, array $ruleN )); } + /** + * @phpstan-return \Generator}> + * + * @psalm-return \Generator}> + * + * @return \Generator}> + */ final public function provideSourceAndRuleNames(): \Generator { $values = [