我收到以下错误:
Fatal error: Declaration of Bean\OauthServerBundle\Form\Type\AuthorizeFormType::buildForm() must be compatible with Symfony\Component\Form\FormTypeInterface::buildForm(Symfony\Component\Form\FormBuilderInterface $builder, array $options) in src/Bean/OauthServerBundle/Form/Type/AuthorizeFormType.php on line 25
不知道为什么我会收到此错误。AbstractType::buildForm() 采用 FormBuilderInterface,Symfony2 为 FormBuilder 实现 FormBuilderInterface。
这是我的来源的内容:
<?php
namespace Bean\OauthServerBundle\Form\Type;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\AbstractType;
class AuthorizeFormType extends AbstractType
{
public function buildForm(FormBuilder $builder, array $options)
{
/* some code ... */
}
/* more code ... */
}