Error when creating custom form I am trying to create a custom form in drupal 8. for that I created my custom module called hello , and i've put inside the hello.routing.yml file the folllowing route:
hello.my_special_form:
  path: '/my-form'
  defaults:
    _title: 'My new form'
    _form: '\Drupal\hello\Form\Test.php'
  requirements:
    _permission: 'access content'

Inside Test.php ,
I have only written :
&lt;?php
/**
 * @file
 * Contains \Drupal\hello\Form\Test.
 */
   namespace Drupal\hello\Form;
   use Drupal\Core\Form\FormBase;
   use Drupal\Core\Form\FormStateInterface;
   class Test extends FormBase {
      
}

I have no errors in my recent log messages, but when I clear cache , the website crashes.I have no idea why specially that I have not written anything yet.
Debugging: If I comment all the Test.php file, the clear cache works fine ! In addition to that, If I only comment the class Test extends FormBase line , the clear cache works as well. so the problem is in the class declaration. Any idea why?
FormBase is abstract; it implements FormInterface, but doesn't contain methods for:

getFormId
buildForm
submitForm

You need to provide those in your class or PHP will reject it.
...
class Test extends FormBase {
  
  public function getFormId() {
    return 'foo';
  }

  public function buildForm(array $form, FormStateInterface $form_state) {
    // Build form then
    return $form;
  }

  public function submitForm(array $form, FormStateInterface $form_state) {
    // Perform submission tasks
  } 

}