Skip to content

Accept closing tags with no names in Symfony console output #1352

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

Open
BenMorel opened this issue Aug 1, 2019 · 3 comments
Open

Accept closing tags with no names in Symfony console output #1352

BenMorel opened this issue Aug 1, 2019 · 3 comments

Comments

@BenMorel
Copy link

BenMorel commented Aug 1, 2019

Symfony console accepts XML-style tags in the output, for example:

$output->writeln('<error>foo</error>');

Unlike XML, the closing tag name is optional, i.e. this is valid:

$output->writeln('<fire>foo</>');

Unfortunately, PHPStorm doesn't like it:

image

More annoyingly, when you attempt to clear the closing tag name, it also clears the opening tag name, and there no real way to prevent this:

image

👇

image

Is this something the Symfony plugin could fix? I'd even be happy with just disabling any XML helpers in OutputInterface::write() strings.

@King2500
Copy link
Contributor

King2500 commented Aug 1, 2019

I think you could disable the XML/HTML language injection inside string literals:
Settings | Editor | Language Injections
image

Or add this comment in front of the string literal: /** @lang text */

@King2500
Copy link
Contributor

King2500 commented Aug 1, 2019

I'm not sure if it's possible for plugins to remove/disable such injections for specific method calls.

@BenMorel
Copy link
Author

BenMorel commented Aug 1, 2019

Hmm too bad, neither of the above solutions find favor in my sight...

Let's wait for more feedback!

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

No branches or pull requests

2 participants