| 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: | public static function fromCoreReflectionPropertyHookType(CoreReflectionPropertyHookType $hookType): string |
| 23: | { |
| 24: | if ($hookType === CoreReflectionPropertyHookType::Get) { |
| 25: | return self::Get; |
| 26: | } |
| 27: | |
| 28: | if ($hookType === CoreReflectionPropertyHookType::Set) { |
| 29: | return self::Set; |
| 30: | } |
| 31: | |
| 32: | throw new \LogicException('Unknown hook type'); |
| 33: | } |
| 34: | } |
| 35: | |