SonataUserBundle переопределить профиль формы

Я использую SonataUserBundle и пытаюсь переопределить форму редактирования профиля, но я не уверен насчет services.yml и config.yml. Вот код

ProfileType.php

namespace Application\Sonata\UserBundle\Form\Type;

use Symfony\Component\Form\FormBuilderInterface;
use Sonata\UserBundle\Form\Type\ProfileType as BaseType;

class ProfileType extends BaseType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        parent::buildForm($builder, $options);
        $builder->add('ciudad', null, array('label' => 'Ciudad'));
        $builder->add('file', 'file', array('required' => false, 'label' => 'Subir Foto'));
    }

    public function getName()
    {
        return 'sonata_user_profile';
    }
}

ProfileFormHandler.php

form->setData($user);
        if ('POST' == $this->request->getMethod()) {
            $this->form->bindRequest($this->request);

            if ($this->form->isValid()) {
                 $nombreArchivoFoto = uniqid().$user->getId() . '-' . $user->getUsername() . '-foto-perfil.jpg';
                $user->upload($nombreArchivoFoto);
                $this->onSuccess($user);
                return true;
            }
            $this->userManager->reloadUser($user);
        }
        return false;
    }
}

services.yml

services:
    sonata_user.registration.form.type:
        class: Application\Sonata\UserBundle\Form\Type\RegistrationFormType
        arguments: [%fos_user.model.user.class%]
        tags:
            - { name: form.type, alias: sonata_user_registration }

    sonata_user.profile.form.type:
        class: Application\Sonata\UserBundle\Form\Type\ProfileType
        arguments: [%fos_user.model.user.class%]
        tags:
            - { name: form.type, alias: sonata_user_profile }

    sonata_user.form.handler.profile:
        class: Application\Sonata\UserBundle\Form\Handler\ProfileFormHandler
        arguments: ["@fos_user.profile.form", "@request", "@fos_user.user_manager"]
        scope: request
        public: false

config.yml

fos_user:
    db_driver: orm
    firewall_name: main
    user_class:  Application\Sonata\UserBundle\Entity\User
    registration:
       form:
            type: application_sonata_user_registration
    profile:
       form:
            type:               fos_user_profile
            handler:            fos_user.profile.form.handler.default
            name:               fos_user_profile_form
            validation_groups:  [Authentication]

sonata_user:
    security_acl:     false
    class:
        user:         Application\Sonata\UserBundle\Entity\User
        group:        Application\Sonata\UserBundle\Entity\Group

    profile:
        form:
            type:               sonata_user_profile
            handler:            sonata_user.form.handler.profile
            name:               sonata_user_profile_form
            validation_groups:  [Profile]

Если я использую вышеуказанные настройки, я получаю следующее исключение

ErrorException: Уведомление во время выполнения: объявление приложения \ Sonata \ UserBundle \ Form \ Handler \ ProfileFormHandler :: process () должно быть совместимо с Sonata \ UserBundle \ Form \ Handler \ ProfileFormHandler :: process (FOS \ UserBundle \ Model \ UserInterface $ user) в строке D: \ xampp \ htdocs \ misplanes.dev \ src \ Application \ Sonata \ UserBundle \ Form \ Handler \ ProfileFormHandler.php 8

И если я изменю services.yml

arguments: ["@sonata_user.profile.form", "@request", "@fos_user.user_manager"]

вместо

arguments: ["@fos_user.profile.form", "@request", "@fos_user.user_manager"]

Я получаю следующее исключение

ServiceNotFoundException: «Сервис»sonata.user.profile.form.handler» имеет зависимость от несуществующего сервиса "sonata_user.profile.form».

Я неЯ действительно не знаю, в чем ошибка, я перепробовал множество конфигураций и прочитал разные форумы и блоги, но я не нашел решения. Я буду очень признателен за вашу помощь. Спасибо

Ответы на вопрос(1)

Ваш ответ на вопрос