diff --git a/lib/Parser/DocumentParser.php b/lib/Parser/DocumentParser.php
index <HASH>..<HASH> 100644
--- a/lib/Parser/DocumentParser.php
+++ b/lib/Parser/DocumentParser.php
@@ -563,7 +563,7 @@ class DocumentParser
             $message = sprintf(
                 'Unknown directive: "%s" %sfor line "%s"',
                 $parserDirective->getName(),
-                $this->environment->getCurrentFileName() ? sprintf('in "%s" ', $this->environment->getCurrentFileName()) : '',
+                $this->environment->getCurrentFileName() !== '' ? sprintf('in "%s" ', $this->environment->getCurrentFileName()) : '',
                 $line
             );
Fix "Only booleans are allowed in a ternary operator condition" phpstan error.