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.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | missing-entity-type-interface-type-hint-2191655-1.patch | 1.03 KB | berdir |
Comments
Comment #1
berdirI 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?
Comment #2
dawehnerIf it is just a single place let's do it here?
Comment #3
berdirHm, #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?
Comment #4
dawehnerIn that case, let's get just this in.
Comment #5
catchCommitted/pushed to 8.x, thanks!