forked from phpstan/phpstan-nette
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHtmlClassReflectionExtension.php
34 lines (26 loc) · 1.04 KB
/
HtmlClassReflectionExtension.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php declare(strict_types = 1);
namespace PHPStan\Reflection\Nette;
use PHPStan\Reflection\ClassReflection;
use PHPStan\Reflection\MethodReflection;
use PHPStan\Reflection\MethodsClassReflectionExtension;
use PHPStan\Reflection\PropertiesClassReflectionExtension;
use PHPStan\Reflection\PropertyReflection;
class HtmlClassReflectionExtension implements MethodsClassReflectionExtension, PropertiesClassReflectionExtension
{
public function hasMethod(ClassReflection $classReflection, string $methodName): bool
{
return $classReflection->is('Nette\Utils\Html');
}
public function getMethod(ClassReflection $classReflection, string $methodName): MethodReflection
{
return new HtmlMethodReflection($methodName, $classReflection);
}
public function hasProperty(ClassReflection $classReflection, string $propertyName): bool
{
return $classReflection->is('Nette\Utils\Html');
}
public function getProperty(ClassReflection $classReflection, string $propertyName): PropertyReflection
{
return new HtmlPropertyReflection($classReflection);
}
}