Global code should be enclosed in global namespace

I have several PHP source files in the following format:

<?php
namespace SomeNamespace {
...
}
?>

PhpStorm displays the errors "Global code Should be enclosed in global namespace declaration" and "No content allowed before namespace declaration" at the last line of these files.

How can I disable this marker?

I already tried several options and found out, that the errors are not displayed in the code Inspection window if I turn of the Option "Annotator" in Settings->Editor->Inspections->General, but the files are still marked as bad in the project explorer and I still see the error marker in the editor.

Deleting the trailing PHP Tag is not an option, because I would have to do that in 1000+ source files.

Any help is appreciated.

0
2 comments
Avatar
Permanently deleted user

This is exactly my issue.

Thank you very much!

0

Please sign in to leave a comment.