Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xi:fallback does not work #7243

Closed
weirdan opened this issue Dec 30, 2021 · 4 comments · Fixed by #7324
Closed

xi:fallback does not work #7243

weirdan opened this issue Dec 30, 2021 · 4 comments · Fixed by #7324
Assignees

Comments

@weirdan
Copy link
Collaborator

weirdan commented Dec 30, 2021

<xi: fallback> is supposed to kick in when the included file is not available, but Psalm instead throws the following exception:

Uncaught RuntimeException: PHP Error: DOMDocument::xinclude(): I/O warning : failed to load external entity "/home/weirdan/src/psalm/psalm/zz.xml" in /home/weirdan/src/psalm/psalm/src/Psalm/Config.php:694 in /home/weirdan/src/psalm/psalm/src/Psalm/Internal/ErrorHandler.php:66
Stack trace:
#0 [internal function]: Psalm\Internal\ErrorHandler::Psalm\Internal\{closure}()
#1 /home/weirdan/src/psalm/psalm/src/Psalm/Config.php(694): DOMDocument->xinclude()
#2 /home/weirdan/src/psalm/psalm/src/Psalm/Config.php(711): Psalm\Config::loadDomDocument()
#3 /home/weirdan/src/psalm/psalm/src/Psalm/Config.php(679): Psalm\Config::validateXmlConfig()
#4 /home/weirdan/src/psalm/psalm/src/Psalm/Config.php(644): Psalm\Config::loadFromXML()
#5 /home/weirdan/src/psalm/psalm/src/Psalm/Config.php(596): Psalm\Config::loadFromXMLFile()
#6 /home/weirdan/src/psalm/psalm/src/Psalm/Internal/CliUtils.php(494): Psalm\Config::getConfigForPath()
#7 /home/weirdan/src/psalm/psalm/src/Psalm/Internal/Cli/Psalm.php(563): Psalm\Internal\CliUtils::initializeConfig()
#8 /home/weirdan/src/psalm/psalm/src/Psalm/Internal/Cli/Psalm.php(1009): Psalm\Internal\Cli\Psalm::loadConfig()
#9 /home/weirdan/src/psalm/psalm/src/Psalm/Internal/Cli/Psalm.php(231): Psalm\Internal\Cli\Psalm::initConfig()
#10 /home/weirdan/src/psalm/psalm/psalm(7): Psalm\Internal\Cli\Psalm::run()
#11 {main}
(Psalm dev-master@1c078136273a669d52d234251ddbae4cd0507d38 crashed due to an uncaught Throwable)

when <xi:include> is used in issueHandlers element:

        <xi:include href="zz.xml">
            <xi:fallback>
                <MixedAssignment>
                    <errorLevel type="suppress">
                        <directory name="vendor/nikic/php-parser" />
                    </errorLevel>
                </MixedAssignment>
            </xi:fallback>
        </xi:include>
@psalm-github-bot
Copy link

Hey @weirdan, can you reproduce the issue on https://psalm.dev ?

@vstm
Copy link
Contributor

vstm commented Jan 6, 2022

I can make a PR for that if it's ok?

@orklah
Copy link
Collaborator

orklah commented Jan 6, 2022

Yeah, please do :)

@weirdan
Copy link
Collaborator Author

weirdan commented Jan 7, 2022

Fixed in #7324

@weirdan weirdan closed this as completed Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants