/** * @param FormInterface $form * @param string|null $data */ private function buildForm(FormInterface $form, $data) { $form->remove('value'); if ($data === null || in_array($data, TextFilter::getSimpleTypes(), true)) { $form->add('value', TextForm::class); } }
public function testSimpleTypes() { $this->assertSame([TextType::TYPE_CONTAINS, TextType::TYPE_NOT_CONTAINS, TextType::TYPE_EQUALS, TextType::TYPE_NOT_EQUALS, TextType::TYPE_STARTS_WITH, TextType::TYPE_NOT_STARTS_WITH, TextType::TYPE_ENDS_WITH, TextType::TYPE_NOT_ENDS_WITH], TextType::getSimpleTypes()); }