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
2525 $ test = $ this ->parseMethod ($ test );
2626
2727 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+ }
2934 } catch (Exception ) {
3035 return null ;
3136 }
@@ -48,7 +53,12 @@ private function parseMethod(string $test): string
4853
4954 private function getAttributeFromClass (string $ test ): ?UseCassette
5055 {
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+ }
5262 $ class = $ method ->getDeclaringClass ();
5363 $ attributes = $ class ->getAttributes (UseCassette::class);
5464
You can’t perform that action at this time.
0 commit comments