$entityName * @param mixed $id * * @return null|T */ public function getReference($entityName, $id) { } } interface EntityManagerInterface { /** * @param class-string $entityName * @param mixed $id * * @return T|null * * @template T */ public function getReference(string $entityName, $id); }