private function validateId(string $id)
    {
        if (!interface_exists($id) && !class_exists($id)) {
            throw new InvalidArgumentException(
                sprintf('Invalid service id "%s". Service id must be an existing interface or class name.', $id)
            );
        }
    }