Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Add return type declarations #19

Merged
merged 1 commit into from Dec 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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