Skip to content
This repository was archived by the owner on Aug 18, 2024. It is now read-only.

Commit b15d8ec

Browse files
authored
Merge pull request #635 from Gizra/isSubclassOf-deprecated
EntityTypeInterface::isSubclassOf() is deprecated.
2 parents f3d15f6 + f50f5aa commit b15d8ec

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/OgGroupAudienceHelper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function getAllGroupAudienceFields($group_content_entity_type_id, $group_
6060
$return = [];
6161
$entity_type = $this->entityTypeManager->getDefinition($group_content_entity_type_id);
6262

63-
if (!$entity_type->isSubclassOf(FieldableEntityInterface::class)) {
63+
if (!$entity_type->entityClassImplements(FieldableEntityInterface::class)) {
6464
// This entity type is not fieldable.
6565
return [];
6666
}

src/OgRouteGroupResolverBase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ protected function getContentEntityPaths() {
119119
/** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
120120
$entity_types = $this->entityTypeManager->getDefinitions();
121121
foreach ($entity_types as $entity_type_id => $entity_type) {
122-
if ($entity_type->isSubclassOf(ContentEntityInterface::class)) {
122+
if ($entity_type->entityClassImplements(ContentEntityInterface::class)) {
123123
$entity_paths = array_fill_keys($entity_type->getLinkTemplates(), $entity_type_id);
124124
$this->contentEntityPaths = array_merge($this->contentEntityPaths, $entity_paths);
125125
}

tests/src/Unit/OgAccessEntityTestBase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function setUp() {
3939

4040
$entity_type = $this->prophesize(EntityTypeInterface::class);
4141
$entity_type->getListCacheTags()->willReturn([]);
42-
$entity_type->isSubclassOf(FieldableEntityInterface::class)->willReturn(TRUE);
42+
$entity_type->entityClassImplements(FieldableEntityInterface::class)->willReturn(TRUE);
4343
$entity_type->id()->willReturn($entity_type_id);
4444

4545
$this->groupContentEntity = $this->prophesize(ContentEntityInterface::class);

tests/src/Unit/Plugin/OgGroupResolver/OgRouteGroupResolverTestBase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ protected function willRetrieveContentEntityPaths() {
179179
// The plugin will need to know if this is a content entity, so we will
180180
// provide this information. We are not requiring this to be called since
181181
// there are other ways of determining this (e.g. `instanceof`).
182-
$entity_type->isSubclassOf(ContentEntityInterface::class)->willReturn(TRUE);
182+
$entity_type->entityClassImplements(ContentEntityInterface::class)->willReturn(TRUE);
183183

184184
// The plugin will need to inquire about the link templates that the
185185
// entity provides. This should be called.

0 commit comments

Comments
 (0)