Code Duplication    Length = 5-5 lines in 3 locations

modules/graphql_core/src/Plugin/GraphQL/Mutations/Entity/UpdateEntity.php 3 locations

@@ 70-74 (lines=5) @@
67
    $storage = $this->entityTypeManager->getStorage($entityTypeId);
68
69
    /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
70
    if (!$entity = $storage->load($args['id'])) {
71
      return new EntityCrudOutputWrapper(NULL, NULL, [
72
        $this->t('The requested @bundle could not be loaded.', ['@bundle' => $bundleName]),
73
      ]);
74
    }
75
76
    if (!$entity->bundle() === $bundleName) {
77
      return new EntityCrudOutputWrapper(NULL, NULL, [
@@ 76-80 (lines=5) @@
73
      ]);
74
    }
75
76
    if (!$entity->bundle() === $bundleName) {
77
      return new EntityCrudOutputWrapper(NULL, NULL, [
78
        $this->t('The requested entity is not of the expected type @bundle.', ['@bundle' => $bundleName]),
79
      ]);
80
    }
81
82
    if (!$entity->access('update')) {
83
      return new EntityCrudOutputWrapper(NULL, NULL, [
@@ 82-86 (lines=5) @@
79
      ]);
80
    }
81
82
    if (!$entity->access('update')) {
83
      return new EntityCrudOutputWrapper(NULL, NULL, [
84
        $this->t('You do not have the necessary permissions to update this @bundle.', ['@bundle' => $bundleName]),
85
      ]);
86
    }
87
88
    // The raw input needs to be converted to use the proper field and property
89
    // keys because we usually convert them to camel case when adding them to