src/Viserio/Component/Parser/Utils/XmlUtils.php
public static function loadFile(string $file, $schemaOrCallable = null): DOMDocument
    {
        if (! \file_exists($file)) {
            throw new FileNotFoundException(\sprintf('No such file [%s] found.', $file));
        }

        return self::loadString(@\file_get_contents($file), $schemaOrCallable);
    }
public static function loadFile(string $file, $schemaOrCallable = null): DOMDocument
    {
        if (! \file_exists($file)) {
            throw new FileNotFoundException(\sprintf('No such file [%s] found.', $file));
        }

        return self::loadString(@\file_get_contents($file), $schemaOrCallable);
    }
Loads an XML file.

@param string               $file             An XML file path
@param null|callable|string $schemaOrCallable An XSD schema file path, a callable, or null to disable validation

@throws \Viserio\Component\Contract\Parser\Exception\InvalidArgumentException When loading of XML file returns error
@throws \Viserio\Component\Contract\Parser\Exception\FileNotFoundException

@return \DOMDocument