private static function setObjectProperties($object, array &$properties, bool $isInternal, Closure $propertyDecoder)
    {
        Closure::bind(function () use ($object, &$properties, $propertyDecoder) {
            foreach ($properties as $key => &$value) {
                $object->$key = $propertyDecoder($value);
            }
        }, null, $isInternal ? null : $object)->__invoke();
    }