src/Viserio/Component/Parser/Parser/XliffParser.php
public function parse(string $payload): array
    {
        try {
            $dom = XmlUtils::loadString($payload);

            $xliffVersion = XliffUtils::getVersionNumber($dom);

            if ($errors = XliffUtils::validateSchema($dom)) {
                throw new InvalidArgumentException(\sprintf(
                    'Invalid resource provided: [%s]; Errors: %s.',
                    $xliffVersion,
                    XmlUtils::getErrorsAsString($errors)
                ));
            }

            if ($xliffVersion === '2.0') {
                return $this->extractXliffVersion2($dom);
            }

            return $this->extractXliffVersion1($dom);
        } catch (InvalidArgumentException $exception) {
            throw new ParseException([
                'message' => $exception->getMessage(),
                'code'    => $exception->getCode(),
                'file'    => $exception->getFile(),
                'line'    => $exception->getLine(),
            ]);
        }
    }
public function parse(string $payload): array
    {
        try {
            $dom = XmlUtils::loadString($payload);

            $xliffVersion = XliffUtils::getVersionNumber($dom);

            if ($errors = XliffUtils::validateSchema($dom)) {
                throw new InvalidArgumentException(\sprintf(
                    'Invalid resource provided: [%s]; Errors: %s.',
                    $xliffVersion,
                    XmlUtils::getErrorsAsString($errors)
                ));
            }

            if ($xliffVersion === '2.0') {
                return $this->extractXliffVersion2($dom);
            }

            return $this->extractXliffVersion1($dom);
        } catch (InvalidArgumentException $exception) {
            throw new ParseException([
                'message' => $exception->getMessage(),
                'code'    => $exception->getCode(),
                'file'    => $exception->getFile(),
                'line'    => $exception->getLine(),
            ]);
        }
    }
{@inheritdoc}