public function handleForm($formClass, $object = null, Request $request, array $formOptions = [])
    {
        $form = $this->createForm($formClass, $object, $formOptions);
        if ($request->isMethod('POST') || $request->isMethod('PUT') || $request->isMethod('PATCH')) {
            $form->handleRequest($request);
            if (!$form->isValid()) {
                return $form;
            }

            if (!$object) {
                $object = $form->getData();
            }

            $this->handleFiles($request->files, $object);
            $this->handleObject($object);
        }

        return $form;
    }