private function validateAbstractSchemaName($schemaName) : void
    {
        if (class_exists($schemaName, true) || interface_exists($schemaName, true)) {
            return;
        }

        try {
            $this->getEntityManager()->getClassMetadata($schemaName);

            return;
        } catch (MappingException $mappingException) {
            $this->semanticalError(
                sprintf('Class %s could not be mapped', $schemaName),
                $this->lexer->token
            );
        }

        $this->semanticalError(sprintf("Class '%s' is not defined.", $schemaName), $this->lexer->token);
    }