Skip to content

Commit a2cb8df

Browse files
committed
Remove setAccessible() usages
1 parent c88869a commit a2cb8df

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

packages/utilities/src/Reflection/ReflectAccessor.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,8 @@ public static function getValue(object $object, string $propertyName): mixed
230230
*/
231231
public static function invoke(object $object, string $methodName, ...$args): mixed
232232
{
233-
$method = new ReflectionMethod($object, $methodName);
234-
$method->setAccessible(true);
235-
236-
return $method->invokeArgs(is_object($object) ? $object : null, $args);
233+
return new ReflectionMethod($object, $methodName)
234+
->invokeArgs(is_object($object) ? $object : null, $args);
237235
}
238236

239237
public static function reflect(mixed $value): Reflector

0 commit comments

Comments
 (0)