File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,12 @@ private function getAttribute(string $test): ?UseCassette
25
25
$ test = $ this ->parseMethod ($ test );
26
26
27
27
try {
28
- $ method = new ReflectionMethod ($ test );
28
+ if (PHP_VERSION_ID < 80300 ) {
29
+ $ method = new ReflectionMethod ($ test );
30
+ } else {
31
+ // @phpstan-ignore-next-line
32
+ $ method = ReflectionMethod::createFromMethodName ($ test );
33
+ }
29
34
} catch (Exception ) {
30
35
return null ;
31
36
}
@@ -48,7 +53,12 @@ private function parseMethod(string $test): string
48
53
49
54
private function getAttributeFromClass (string $ test ): ?UseCassette
50
55
{
51
- $ method = new ReflectionMethod ($ test );
56
+ if (PHP_VERSION_ID < 80300 ) {
57
+ $ method = new ReflectionMethod ($ test );
58
+ } else {
59
+ // @phpstan-ignore-next-line
60
+ $ method = ReflectionMethod::createFromMethodName ($ test );
61
+ }
52
62
$ class = $ method ->getDeclaringClass ();
53
63
$ attributes = $ class ->getAttributes (UseCassette::class);
54
64
You can’t perform that action at this time.
0 commit comments