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: DocBlock #237

Merged
merged 1 commit into from
Nov 1, 2020
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: 1 addition & 5 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,12 @@
<code>getFixers</code>
<code>registerBuiltInFixers</code>
</InternalMethod>
<MixedInferredReturnType occurrences="3">
<MixedInferredReturnType occurrences="2">
<code>\Generator</code>
<code>\Generator</code>
<code>array&lt;int, string&gt;</code>
</MixedInferredReturnType>
<MixedMethodCall occurrences="1">
<code>getRules</code>
</MixedMethodCall>
<MixedReturnStatement occurrences="1">
<code>$builtInFixerNames</code>
</MixedReturnStatement>
</file>
</files>
13 changes: 12 additions & 1 deletion test/Unit/RuleSet/AbstractRuleSetTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ final public function provideRuleNames(): \Generator
}

/**
* @phpstan-return class-string
*
* @psalm-return class-string
*
* @throws \RuntimeException
*/
final protected static function className(): string
Expand All @@ -194,6 +198,14 @@ final protected static function className(): string
));
}

if (!\class_exists($className)) {
throw new \RuntimeException(\sprintf(
'Class name "%s" resolved from test class name "%s" does not reference a class that exists.',
$className,
static::class
));
}

return $className;
}

Expand All @@ -202,7 +214,6 @@ final protected static function className(): string
*/
final protected static function createRuleSet(?string $header = null): Config\RuleSet
{
/** @var class-string $className */
$className = self::className();

$reflection = new \ReflectionClass($className);
Expand Down