Skip to content
This repository was archived by the owner on Mar 12, 2024. It is now read-only.

Commit 3f40f27

Browse files
committed
support for php 8.0 private/protected properties
1 parent ca02acb commit 3f40f27

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Traits/LoopFunctions.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,11 @@ public function dumpProperties(
9696
->getProperties($filter);
9797

9898
$collection = collect($properties)->mapWithKeys(
99-
fn (\ReflectionProperty $property) => [
100-
$property->getName() => $property->getValue($class),
101-
]
99+
function (\ReflectionProperty $property) use ($class) {
100+
$property->setAccessible(true);
101+
102+
return [$property->getName() => $property->getValue($class)];
103+
}
102104
);
103105

104106
if ($asCollection) {

0 commit comments

Comments
 (0)