getCenter(); } if ($entity instanceof HasCentersInterface) { return $entity->getCenters(); } throw new \UnexpectedValueException('should be an instanceof'); } public function supports($entity, ?array $options = []): bool { return $entity instanceof HasCenterInterface || $entity instanceof HasCentersInterface; } }