Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. GlobalDrupalSniff.php

GlobalDrupalSniff::$baseClasses

List of base classes where \Drupal should not be used in an extending class.

Type: string[]

File

vendor/drupal/coder/coder_sniffer/DrupalPractice/Sniffs/Objects/GlobalDrupalSniff.php, line 31

Class

GlobalDrupalSniff
Checks that \Drupal::service() and friends is not used in forms, controllers, services.

Namespace

DrupalPractice\Sniffs\Objects

Code

public static $baseClasses = [
    'BlockBase',
    'ConfigFormBase',
    'ContentEntityForm',
    'ControllerBase',
    'EntityForm',
    'EntityReferenceFormatterBase',
    'FileFormatterBase',
    'FormatterBase',
    'FormBase',
    'ImageFormatter',
    'ImageFormatterBase',
    'WidgetBase',
];

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal