Once it is used in the context of the form creation, I think it makes sense to use
setAction and setMethod (is more intuitive):

```php
$form = $this->createFormBuilder($task)
                ->setAction($this->generateUrl('target_route'))
                ->setMethod('GET')
                ->add('task', 'text')
                ->getForm();
```

or maybe: setFormAction and setFormMethod