Skip to content

Commit

Permalink
Merge pull request #19 from ergebnis/fix/return
Browse files Browse the repository at this point in the history
Fix: Add return type declarations
  • Loading branch information
localheinz committed Dec 23, 2019
2 parents 94017e4 + 06ed41e commit db46b6c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/RuleSet.php
Expand Up @@ -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).
Expand All @@ -36,5 +36,5 @@ public function rules();
*
* @return int
*/
public function targetPhpVersion();
public function targetPhpVersion(): int;
}
5 changes: 1 addition & 4 deletions test/Unit/FactoryTest.php
Expand Up @@ -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,
Expand Down
10 changes: 2 additions & 8 deletions test/Unit/RuleSet/AbstractRuleSetTestCase.php
Expand Up @@ -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' => '',
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit db46b6c

Please sign in to comment.