Skip to content

Commit

Permalink
Merge pull request #238 from ergebnis/fix/docblock
Browse files Browse the repository at this point in the history
Fix: DocBlock
  • Loading branch information
ergebnis-bot committed Nov 1, 2020
2 parents fce058a + d3363c0 commit 733fdae
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 14 deletions.
11 changes: 4 additions & 7 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="3.18.2@19aa905f7c3c7350569999a93c40ae91ae4e1626">
<file src="test/Unit/FactoryTest.php">
<MixedInferredReturnType occurrences="1">
<code>\Generator</code>
</MixedInferredReturnType>
<MixedPropertyTypeCoercion occurrences="2">
<code>$rules</code>
<code>$rules</code>
</MixedPropertyTypeCoercion>
</file>
<file src="test/Unit/RuleSet/AbstractRuleSetTestCase.php">
<InternalClass occurrences="2">
Expand All @@ -16,10 +17,6 @@
<code>getFixers</code>
<code>registerBuiltInFixers</code>
</InternalMethod>
<MixedInferredReturnType occurrences="2">
<code>\Generator</code>
<code>\Generator</code>
</MixedInferredReturnType>
<MixedMethodCall occurrences="1">
<code>getRules</code>
</MixedMethodCall>
Expand Down
2 changes: 2 additions & 0 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ final class Factory
/**
* Creates a configuration based on a rule set.
*
* @param array<string, array|bool> $overrideRules
*
* @throws \RuntimeException
*/
public static function fromRuleSet(RuleSet $ruleSet, array $overrideRules = []): Config
Expand Down
2 changes: 2 additions & 0 deletions src/RuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public function name(): string;

/**
* Returns an array of rules along with their configuration.
*
* @return array<string, array|bool>
*/
public function rules(): array;

Expand Down
2 changes: 1 addition & 1 deletion src/RuleSet/AbstractRuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ abstract class AbstractRuleSet implements RuleSet
protected $name = '';

/**
* @var array
* @var array<string, array|bool>
*/
protected $rules = [];

Expand Down
7 changes: 5 additions & 2 deletions test/Unit/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function testFromRuleSetCreatesConfig(int $targetPhpVersion): void
private $name;

/**
* @var array
* @var array<string, array|bool>
*/
private $rules;

Expand Down Expand Up @@ -124,6 +124,9 @@ public function targetPhpVersion(): int
self::assertSame($rules, $config->getRules());
}

/**
* @return \Generator<int, array{0: int}>
*/
public function provideTargetPhpVersion(): \Generator
{
$values = [
Expand Down Expand Up @@ -158,7 +161,7 @@ public function testFromRuleSetCreatesConfigWithOverrideRules(): void
private $name;

/**
* @var array
* @var array<string, array|bool>
*/
private $rules;

Expand Down
14 changes: 10 additions & 4 deletions test/Unit/RuleSet/AbstractRuleSetTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ final public function testHeaderCommentFixerIsEnabledIfHeaderIsProvided(string $
self::assertSame($expected, $rules['header_comment']);
}

/**
* @return \Generator<string, array{0: string}>
*/
final public function provideValidHeader(): \Generator
{
$values = [
Expand All @@ -124,8 +127,6 @@ final public function provideValidHeader(): \Generator

/**
* @dataProvider provideSourceAndRuleNames
*
* @param string[] $ruleNames
*/
final public function testRulesAreSortedByName(string $source, array $ruleNames): void
{
Expand All @@ -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
{
Expand All @@ -157,6 +156,13 @@ final public function testRulesDoNotContainRuleSets(string $source, array $ruleN
));
}

/**
* @phpstan-return \Generator<int, array{0: class-string, 1: array<string>}>
*
* @psalm-return \Generator<int, array{0: class-string, 1: array<string>}>
*
* @return \Generator<int, array{0: string, 1: array<string>}>
*/
final public function provideSourceAndRuleNames(): \Generator
{
$values = [
Expand Down

0 comments on commit 733fdae

Please sign in to comment.