Skip to content

Commit 2d2f439

Browse files
author
Pedro Cambra
committed
Classes extending entity interface should not trigger DI warnings
1 parent 36a2b01 commit 2d2f439

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Rules/Drupal/GlobalDrupalDependencyInjectionRule.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public function processNode(Node $node, Scope $scope): array
3737
'Drupal\Core\Render\Element\ElementInterface',
3838
'Drupal\Core\Render\Element\FormElementInterface',
3939
'Drupal\config_translation\FormElement\ElementInterface',
40+
// Entities don't use services for now
41+
// @see https://www.drupal.org/project/drupal/issues/2913224
42+
'Drupal\Core\Entity\EntityInterface',
4043
];
4144
$classReflection = $scope->getClassReflection()->getNativeReflection();
4245
foreach ($whitelist as $item) {

0 commit comments

Comments
 (0)