Skip to content

Commit 76f4072

Browse files
committed
TASK: Use class_exists
1 parent 862ff84 commit 76f4072

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/Service/ValidatorClassNameResolver.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace SaschaEgerer\PhpstanTypo3\Service;
44

5-
use PHPStan\Reflection\ReflectionProvider;
65
use PHPStan\Type\Constant\ConstantStringType;
76
use PHPStan\Type\Type;
87
use ReflectionMethod;
@@ -11,25 +10,17 @@
1110
final class ValidatorClassNameResolver
1211
{
1312

14-
/** @var ReflectionProvider */
15-
private $reflectionProvider;
16-
17-
public function __construct(ReflectionProvider $reflectionProvider)
18-
{
19-
$this->reflectionProvider = $reflectionProvider;
20-
}
21-
2213
public function resolve(Type $type): ?string
2314
{
2415
if ( ! $type instanceof ConstantStringType) {
2516
return null;
2617
}
2718

28-
if ($this->reflectionProvider->hasClass(\TYPO3\CMS\Extbase\Validation\ValidatorClassNameResolver::class)) {
19+
if (class_exists(\TYPO3\CMS\Extbase\Validation\ValidatorClassNameResolver::class)) {
2920
return \TYPO3\CMS\Extbase\Validation\ValidatorClassNameResolver::resolve($type->getValue());
3021
}
3122

32-
if ( ! $this->reflectionProvider->hasClass(ValidatorResolver::class)) {
23+
if (!class_exists(ValidatorResolver::class)) {
3324
return null;
3425
}
3526

0 commit comments

Comments
 (0)