Remove depreciated methods and unused imports in code base.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

heykarthikwithu created an issue. See original summary.

heykarthikwithu’s picture

Assigned: heykarthikwithu » Unassigned
Status: Active » Needs review
FileSize
4.12 KB
nedjo’s picture

Status: Needs review » Needs work

Thanks for the patch.

Suggestions:

  • Update property and variable names from ::entityManager to ::entityTypeManager and from $entity_manager to $entity_type_manager. See e.g. the property and variable names used in EntityBundleListener.
  • Make sure to update the code documentation to reflect the new object type used in class properties and constructors. Examples:
      /**
       * The entity manager.
       *
       * @var \Drupal\Core\Entity\EntityManagerInterface
       */
      protected $entityManager;
    
       * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
       *   The entity manager.
    
heykarthikwithu’s picture

Assigned: Unassigned » heykarthikwithu

working on this.

heykarthikwithu’s picture

Assigned: heykarthikwithu » Unassigned
Status: Needs work » Needs review
FileSize
7.71 KB
5.04 KB

As per #3, suggestions are updated.

jhodgdon’s picture

That looks good, thanks! I think it may conflict with some similar work done as part of #2659178: Add delete capability, so I think I'll wait to commit this for a bit.

jhodgdon’s picture

Status: Needs review » Needs work

Sorry, I forgot about this... and indeed it doesn't apply any more.

heykarthikwithu’s picture

Assigned: Unassigned » heykarthikwithu

working on this.

heykarthikwithu’s picture

Assigned: heykarthikwithu » Unassigned
Status: Needs work » Needs review
FileSize
4.91 KB

rerolled.

jhodgdon’s picture

Status: Needs review » Fixed

Thanks! I can definitely apply this patch... but:

  1. +++ b/src/ConfigLister.php
    @@ -62,7 +62,7 @@ class ConfigLister implements ConfigListInterface {
    -   * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
    +   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager
    

    I thought in the last version of this patch, besides using EntityTypeManagerInterface, it also changed the local/member variable names to $entity_type_manager? That seemed like a good idea.

  2. +++ b/src/ConfigReverter.php
    @@ -61,7 +61,7 @@ class ConfigReverter implements ConfigRevertInterface, ConfigDeleteInterface {
    +   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager
    

    Here too.

Although I guess that changing even protected member variable names is probably not a good idea... so OK, let's leave the variable names as-is. I'll just commit this. Thanks again!

heykarthikwithu’s picture

@jhodgdon yes, local variable name can also be $entity_type_manager .
okay, thanks.

Status: Fixed » Closed (fixed)

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