Skip to content

Commit

Permalink
Fix PHPStan error with is_subclass_of
Browse files Browse the repository at this point in the history
  • Loading branch information
villfa committed Jul 6, 2022
1 parent 7185468 commit fca4871
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ parameters:
- %currentWorkingDirectory%/src/

checkGenericClassInNonGenericObjectType: false
reportUnmatchedIgnoredErrors: true
ignoreErrors:
- '/Construct empty\(\) is not allowed\. Use more strict comparison/'
- '/Call to function is_subclass_of\(\) with class-string and class-string will always evaluate to true/'
- '/Casting to .+ something that''s already/'

symfony:
Expand Down
5 changes: 4 additions & 1 deletion src/Event/HookLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ final class HookLoader
{
/**
* @var array<string, string>
* @psalm-var array<class-string<\Churn\Event\Subscriber\HookDecorator>, class-string>
* @psalm-var array<
* class-string<\Churn\Event\Subscriber\HookDecorator>,
* class-string<AfterAnalysisHook>|class-string<AfterFileAnalysisHook>|class-string<BeforeAnalysisHook>
* >
*/
private $decorators;

Expand Down
1 change: 1 addition & 0 deletions tests/Integration/Command/RunCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ public function it_can_use_a_hook_by_path(): void
public function it_throws_for_invalid_hooks(): void
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid hook: invalid-hook');
$this->commandTester->execute([
'paths' => [__FILE__, __DIR__ . '/AssessComplexityCommandTest.php'],
'-c' => __DIR__ . '/config/hook-invalid.yml',
Expand Down

0 comments on commit fca4871

Please sign in to comment.