File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,9 @@ public static function from($target)
1919 {
2020 return collect ((new ReflectionClass ($ target ))->getProperties ())
2121 ->mapWithKeys (function ($ property ) use ($ target ) {
22- $ property ->setAccessible (true );
22+ if (PHP_VERSION_ID < 80500 ) {
23+ $ property ->setAccessible (true );
24+ }
2325
2426 if (PHP_VERSION_ID >= 70400 && ! $ property ->isInitialized ($ target )) {
2527 return [];
Original file line number Diff line number Diff line change @@ -130,7 +130,9 @@ protected static function modelsFor(array $targets)
130130 {
131131 return collect ($ targets )->map (function ($ target ) {
132132 return collect ((new ReflectionClass ($ target ))->getProperties ())->map (function ($ property ) use ($ target ) {
133- $ property ->setAccessible (true );
133+ if (PHP_VERSION_ID < 80500 ) {
134+ $ property ->setAccessible (true );
135+ }
134136
135137 if (PHP_VERSION_ID < 70400 || ! is_object ($ target ) || $ property ->isInitialized ($ target )) {
136138 return static ::resolveValue ($ property ->getValue ($ target ));
Original file line number Diff line number Diff line change @@ -127,7 +127,10 @@ public function test_format_listeners($listener, $formatted)
127127 Event::listen (DummyEvent::class, $ listener );
128128
129129 $ method = new \ReflectionMethod (EventWatcher::class, 'formatListeners ' );
130- $ method ->setAccessible (true );
130+
131+ if (PHP_VERSION_ID < 80500 ) {
132+ $ method ->setAccessible (true );
133+ }
131134
132135 $ this ->assertSame ($ formatted , $ method ->invoke (new EventWatcher , DummyEvent::class)[0 ]['name ' ]);
133136 }
You can’t perform that action at this time.
0 commit comments