src/Yggdrasil/Utils/Form/FormDataWrapper.php
public static function wrap(object $dto, array $data): object
    {
        foreach ($data as $key => $value) {
            $setter = 'set' . ucfirst($key);

            if (method_exists($dto, $setter)) {
                $dto->{$setter}($value);
            }
        }

        return $dto;
    }
public static function wrap(object $dto, array $data): object
    {
        foreach ($data as $key => $value) {
            $setter = 'set' . ucfirst($key);

            if (method_exists($dto, $setter)) {
                $dto->{$setter}($value);
            }
        }

        return $dto;
    }
public static function wrap ( object $ dto , array $ data ) : object { foreach ( $ data as $ key => $ value ) { $ setter = 'set' . ucfirst ( $ key ) ; if ( method_exists ( $ dto , $ setter ) ) { $ dto -> { $ setter } ( $ value ) ; } } return $ dto ; }
Wraps given DTO with form data collection

@param object $dto
@param array $data
@return object
Wraps given DTO with form data collection