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