File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,11 @@ protected function getCurrentSentryScope(): Scope
125125 $ hub = $ this ->getSentryHubFromContainer ();
126126
127127 $ method = new ReflectionMethod ($ hub , 'getScope ' );
128- $ method ->setAccessible (true );
128+ if (\PHP_VERSION_ID < 80100 )
129+ {
130+ // This method is no-op starting from PHP 8.1; see also https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible
131+ $ method ->setAccessible (true );
132+ }
129133
130134 return $ method ->invoke ($ hub );
131135 }
@@ -136,7 +140,11 @@ protected function getCurrentSentryBreadcrumbs(): array
136140 $ scope = $ this ->getCurrentSentryScope ();
137141
138142 $ property = new ReflectionProperty ($ scope , 'breadcrumbs ' );
139- $ property ->setAccessible (true );
143+ if (\PHP_VERSION_ID < 80100 )
144+ {
145+ // This method is no-op starting from PHP 8.1; see also https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible
146+ $ property ->setAccessible (true );
147+ }
140148
141149 return $ property ->getValue ($ scope );
142150 }
You can’t perform that action at this time.
0 commit comments