You are here

public function TestForm::buildForm in Coder 8.3

Same name in this branch
  1. 8.3 tests/DrupalPractice/Objects/GlobalDrupalUnitTest.inc \TestForm::buildForm()
  2. 8.3 tests/DrupalPractice/Objects/GlobalClassUnitTest.inc \TestForm::buildForm()
  3. 8.3 tests/DrupalPractice/Objects/drupal8/TestForm.php \TestForm::buildForm()
Same name and namespace in other branches
  1. 8.2 coder_sniffer/DrupalPractice/Test/Objects/GlobalFunctionUnitTest.inc \TestForm::buildForm()
  2. 8.2 coder_sniffer/DrupalPractice/Test/Objects/GlobalDrupalUnitTest.inc \TestForm::buildForm()
  3. 8.2 coder_sniffer/DrupalPractice/Test/Objects/GlobalClassUnitTest.inc \TestForm::buildForm()
  4. 8.3.x tests/DrupalPractice/Objects/GlobalDrupalUnitTest.inc \TestForm::buildForm()
  5. 8.3.x tests/DrupalPractice/Objects/GlobalClassUnitTest.inc \TestForm::buildForm()
  6. 8.3.x tests/DrupalPractice/Objects/drupal8/TestForm.php \TestForm::buildForm()

File

tests/DrupalPractice/Objects/GlobalDrupalUnitTest.inc, line 5

Class

TestForm

Code

public function buildForm($form, $form_state) {
  $form['something'] = \Drupal::service('foobar')
    ->result();

  // Accessing the Drupal version is fine and should not trigger a warning.
  $version = \Drupal::VERSION;
}