Follow-up from #2165155: Change $entity_type to $entity_type_id and $entity_info to $entity_type/$entity_types.

Make sure that we type hint $entity_type wherever it is an EntityTypeInterface.

We won't be able to rename all $entity_type strings to $entity_type_id, but if we consequently type hint if it is the object, it should be clear enough.

Comments

berdir’s picture

Status: Active » Needs review
StatusFileSize
new1.03 KB

I couldn't find any other case other than the originally mentioned ContentTranslationController. The only other $entity_type parameter to __construct() that is not type hinted as EntityTypeInterface is the Entity Query class and that's actually an entity_type_id string. Might make sense to switch that but not sure about doing it here?

dawehner’s picture

If it is just a single place let's do it here?

berdir’s picture

Hm, #2191651: Rename Drupal\Core\Entity\Query\QueryInterface::getEntityType() to getEntityTypeId() might be the better place for that, as this would then otherwise conflict with that issue?

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

In that case, let's get just this in.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

Status: Fixed » Closed (fixed)

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