getFormId() must be compatible with Drupal\Core\Form\FormBuilderInterface::getFormId (Drupal 8) I newish to Drupal and very new to Drupal 8, as this comes out in a couple of weeks it seems to make sense to grab the bull by the horns and start any new project with this now! Anyway I was following pretty good tutorial: http://www.drupalwoo.com/content/blog/my-first-drupal-8-module on creating a Drupal 8 module but it looks to be a year or two old and things have changed. I am getting the following error:

Fatal error: Declaration of Drupal\bd_contact\AddForm::getFormId() must be compatible with Drupal\Core\Form\FormBuilderInterface::getFormId($form_arg, Drupal\Core\Form\FormStateInterface &amp;$form_state) in modules\custom\bd_contact\src\AddForm.php on line 7

This is the file in question: https://github.com/nlisgo/bd_contact/blob/master/src/AddForm.php could anyone tell me what would be the correct way? I have googled it quite a bit and found similar issues but I can't see how I'd integrate those changes into mine.
In my project it works as public function without arguments since drupal beta 1 until today (i've updated today to rc3):

 public function getFormId() {


You only have to add public to your function.

Otherwise your error suggest, that there are the two arguments form and form_state missing, what is also described in the api.drupal.org:

public function FormBuilder::getFormId

But I don't think, that you need these arguments in the definition of the getFormId(). This is probably a false alarm. You only need these arguments, when using the function in the context of formBuilder, when you don't provide the form through your class, for example like this:

this-&gt;formBuilder-&gt;getFormId($form_arg, $form_state)


Edit:
Berdir has the right clue, you have to change this:

wrong: class AddForm implements FormInterface {
right: class AddForm extends FormBase {


and the use statements for this are:

use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;


This is a complete example:

&lt;?php
/**
 * @file
 * Contains \Drupal\mymodule\Form\OrderForm
 */

namespace Drupal\mymodule\Form;

use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;

/**
 * Implements an form.
 */
class OrderForm extends FormBase {

  /**
   * {@inheritdoc}.
   */
  public function getFormId() {
    return 'mymodule_order_form';
  }

  /**
   * {@inheritdoc}.
   */
  public function buildForm(array $form, FormStateInterface $form_state) {

  }


   /**
   * {@inheritdoc}
   */
  public function validateForm(array &amp;$form, FormStateInterface $form_state) {

  }


   /**
   * {@inheritdoc}
   */
  public function submitForm(array &amp;$form, FormStateInterface $form_state) {

  }