1: | <?php |
2: | |
3: | declare(strict_types=1); |
4: | |
5: | namespace PHPStan\BetterReflection\Reflection; |
6: | |
7: | use PropertyHookType as CoreReflectionPropertyHookType; |
8: | |
9: | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | |
16: | |
17: | class ReflectionPropertyHookType |
18: | { |
19: | const Get = 'get'; |
20: | const Set = 'set'; |
21: | |
22: | |
23: | public static function fromCoreReflectionPropertyHookType(CoreReflectionPropertyHookType $hookType): string |
24: | { |
25: | if ($hookType === CoreReflectionPropertyHookType::Get) { |
26: | return self::Get; |
27: | } |
28: | |
29: | if ($hookType === CoreReflectionPropertyHookType::Set) { |
30: | return self::Set; |
31: | } |
32: | |
33: | throw new \LogicException('Unknown hook type'); |
34: | } |
35: | } |
36: | |