Skip to content

Commit 410ea5a

Browse files
authored
Merge pull request #15 from pcambra/entity-interface
Classes extending entity interface should not trigger DI warnings
2 parents 691acb4 + 2d2f439 commit 410ea5a

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
@@ -38,6 +38,9 @@ public function processNode(Node $node, Scope $scope): array
3838
'Drupal\Core\Render\Element\ElementInterface',
3939
'Drupal\Core\Render\Element\FormElementInterface',
4040
'Drupal\config_translation\FormElement\ElementInterface',
41+
// Entities don't use services for now
42+
// @see https://www.drupal.org/project/drupal/issues/2913224
43+
'Drupal\Core\Entity\EntityInterface',
4144
];
4245
$classReflection = $scopeClassReflection->getNativeReflection();
4346
foreach ($whitelist as $item) {

0 commit comments

Comments
 (0)