If a class is a service and registered in a *.services.yml file then it should not use \Drupal calls and use dependency injection instead.

Comments

klausi created an issue. See original summary.

  • klausi committed 8801384 on 8.x-2.x
    feat(GlobalDrupalSniff): Detect \Drupal calls in service classes (#...

  • klausi committed 2ddb508 on 8.x-2.x
    feat(GlobalClassSniff): Detect Node::load() calls in service classes (#...
  • klausi committed a03fe61 on 8.x-2.x
    feat(GlobalFunctionSniff): Detect t() calls in service classes (#2847690...
klausi’s picture

Status: Active » Fixed

Implemented.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.