diff --git a/src/Reflect/properties_get.php b/src/Reflect/properties_get.php index b6cf805..84a2eab 100644 --- a/src/Reflect/properties_get.php +++ b/src/Reflect/properties_get.php @@ -6,7 +6,7 @@ use VeeWee\Reflecta\Reflect\Exception\UnreflectableException; use VeeWee\Reflecta\Reflect\Type\ReflectedClass; use VeeWee\Reflecta\Reflect\Type\ReflectedProperty; -use function Psl\Dict\pull; +use function Psl\Dict\map; /** * @param null|Closure(ReflectedProperty): bool $predicate @@ -16,9 +16,8 @@ */ function properties_get(object $object, Closure|null $predicate = null): array { - return pull( + return map( ReflectedClass::fromObject($object)->properties($predicate), static fn (ReflectedProperty $property): mixed => property_get($object, $property->name()), - static fn (ReflectedProperty $property): string => $property->name() ); }