Component/FilterComponent.php
public function createForm(array $formOptions = [])
    {
        $defaults = $this->filterDefaults();

        $this->form = $this->formFactory->create(
            $this->formType,
            $defaults,
            $formOptions
        );
        if ($this->request) {
            $this->form->handleRequest($this->request);
        }

        return $this->form;
    }
public function createForm(array $formOptions = [])
    {
        $defaults = $this->filterDefaults();

        $this->form = $this->formFactory->create(
            $this->formType,
            $defaults,
            $formOptions
        );
        if ($this->request) {
            $this->form->handleRequest($this->request);
        }

        return $this->form;
    }
Creates the filter form and pulls the filter values from request.

@param array $formOptions Options to pass to the form.
@return \Symfony\Component\Form\FormInterface