Laracasts\Validation\FormValidator::normalizeFormData PHP Method

normalizeFormData() protected method

Normalize the provided data to an array.
protected normalizeFormData ( mixed $formData ) : array
$formData mixed
return array
    protected function normalizeFormData($formData)
    {
        // If an object was provided, maybe the user
        // is giving us something like a DTO.
        // In that case, we'll grab the public properties
        // off of it, and use that.
        if (is_object($formData)) {
            return get_object_vars($formData);
        }
        // Otherwise, we'll just stick with what they provided.
        return $formData;
    }