1: <?php
2:
3: declare(strict_types=1);
4:
5: namespace PHPStan\BetterReflection\Reflection\Adapter;
6:
7: use PHPStan\BetterReflection\Reflection\ReflectionAttribute as BetterReflectionAttribute;
8:
9: use const PHP_VERSION_ID;
10:
11: final class ReflectionAttributeFactory
12: {
13: /**
14: * @return \PHPStan\BetterReflection\Reflection\Adapter\ReflectionAttribute|\PHPStan\BetterReflection\Reflection\Adapter\FakeReflectionAttribute
15: */
16: public static function create(BetterReflectionAttribute $betterReflectionAttribute)
17: {
18: if (PHP_VERSION_ID >= 80000 && PHP_VERSION_ID < 80012) {
19: return new FakeReflectionAttribute($betterReflectionAttribute);
20: }
21:
22: return new ReflectionAttribute($betterReflectionAttribute);
23: }
24: }
25: