Skip to content

Commit

Permalink
Fix PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Nov 25, 2022
1 parent aebf269 commit 07aef16
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace IdeHelper\Annotator\ClassAnnotatorTask;

use ReflectionClass;
use Throwable;

/**
Expand All @@ -24,13 +25,14 @@ public function shouldRun(string $path, string $content): bool {
return true;
}

/** @var class-string|null $className */
$className = $this->getClassName($path, $content);
if (!$className) {
return false;
}

try {
return (new \ReflectionClass($className))->hasMethod('loadModel');
return (new ReflectionClass($className))->hasMethod('loadModel');
} catch (Throwable $exception) {
return false;
}
Expand Down

0 comments on commit 07aef16

Please sign in to comment.