protected function assertSubmitedFormIsValid(Request $request, FormInterface $form)
    {
        $form->submit(
            $this->getRequestData($request),
            $request->getMethod() !== 'PATCH'
        );

        if (!$valid = $form->isValid()) {
            throw new ValidationException(
                $form->getData(),
                $form->getErrors(true, true) // deep & flattened
            );
        }
    }
protected function assertSubmitedFormIsValid(Request $request, FormInterface $form)
    {
        $form->submit(
            $this->getRequestData($request),
            $request->getMethod() !== 'PATCH'
        );

        if (!$valid = $form->isValid()) {
            throw new ValidationException(
                $form->getData(),
                $form->getErrors(true, true) // deep & flattened
            );
        }
    }
protected function assertSubmitedFormIsValid ( Request $ request , FormInterface $ form ) { $ form -> submit ( $ this -> getRequestData ( $ request ) , $ request -> getMethod ( ) !== 'PATCH' ) ; if ( ! $ valid = $ form -> isValid ( ) ) { throw new ValidationException ( $ form -> getData ( ) , $ form -> getErrors ( true , true ) // deep & flattened ) ; } }
Custom method for form submission to handle http method bugs, and extra fields
error options.

@param Request       $request
@param FormInterface $form

@throws HttpException       if invalid json data
@throws ValidationException if invalid form
Custom method for form submission to handle http method bugs and extra fields error options .