Object parameters should be type hinted

  • Minor
  • Bugrisk

More information: https://insight.symfony.com/what-we-analyse/php.object_parameter_not_type_hinted

  1. // ManyToMany association
  2. elseif (isset($assoc['joinTable'])) {
  3. $relatedItems = PropertyAccess::createPropertyAccessor()->getValue(
  4. $parentEntity, $parentEntityProperty
  5. );
  6. $itemIds = $relatedItems->map(function ($entity) {

    The parameter entity, which is an object, should be typehinted.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by PéCé
  7. return $entity->getId();
  8. });
  9. return ['entity.id' => $itemIds->toArray()];
  10. }