From 06ed41e4d70b19182234b0a136e2e4d7f56388be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 23 Dec 2019 10:19:57 +0100 Subject: [PATCH] Fix: Add return type declarations --- src/RuleSet.php | 6 +++--- test/Unit/FactoryTest.php | 5 +---- test/Unit/RuleSet/AbstractRuleSetTestCase.php | 10 ++-------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/RuleSet.php b/src/RuleSet.php index 9c6e66ed..3b95eeb4 100644 --- a/src/RuleSet.php +++ b/src/RuleSet.php @@ -20,14 +20,14 @@ interface RuleSet * * @return string */ - public function name(); + public function name(): string; /** * Returns an array of rules along with their configuration. * * @return array */ - public function rules(); + public function rules(): array; /** * Returns the minimum required PHP version (PHP_VERSION_ID). @@ -36,5 +36,5 @@ public function rules(); * * @return int */ - public function targetPhpVersion(); + public function targetPhpVersion(): int; } diff --git a/test/Unit/FactoryTest.php b/test/Unit/FactoryTest.php index 41cb9130..017edb0f 100644 --- a/test/Unit/FactoryTest.php +++ b/test/Unit/FactoryTest.php @@ -99,10 +99,7 @@ public function testFromRuleSetCreatesConfig(int $targetPhpVersion): void self::assertSame($rules, $config->getRules()); } - /** - * @return \Generator - */ - public function providerTargetPhpVersion() + public function providerTargetPhpVersion(): \Generator { $values = [ \PHP_VERSION_ID - 1, diff --git a/test/Unit/RuleSet/AbstractRuleSetTestCase.php b/test/Unit/RuleSet/AbstractRuleSetTestCase.php index 3ee636c5..4f6c29e5 100644 --- a/test/Unit/RuleSet/AbstractRuleSetTestCase.php +++ b/test/Unit/RuleSet/AbstractRuleSetTestCase.php @@ -107,10 +107,7 @@ final public function testHeaderCommentFixerIsEnabledIfHeaderIsProvided($header) self::assertSame($expected, $rules['header_comment']); } - /** - * @return \Generator - */ - final public function providerValidHeader() + final public function providerValidHeader(): \Generator { $values = [ 'string-empty' => '', @@ -145,10 +142,7 @@ final public function testRulesAreSortedByName($source, $ruleNames): void )); } - /** - * @return \Generator - */ - final public function providerRuleNames() + final public function providerRuleNames(): \Generator { $values = [ 'rule set' => self::createRuleSet()->rules(),