Skip to content

Commit 17a2473

Browse files
authored
Merge pull request #132 from jbrada/master
Omit namespace for non-namespace Factory
2 parents e1d60fb + ba5b7aa commit 17a2473

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/bitExpert/PHPStan/Magento/Autoload/FactoryAutoloader.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ protected function getFileContents(string $class): string
6161
$namespace = implode('\\', $namespace);
6262

6363
$template = "<?php\n";
64-
$template .= "namespace {NAMESPACE};\n\n";
64+
65+
if ($namespace !== '') {
66+
$template .= "namespace {NAMESPACE};\n\n";
67+
}
68+
6569
$template .= "/**\n";
6670
$template .= " * Factory class for @see \{NAMESPACE}\{CLASSNAME}\n";
6771
$template .= " */\n";

0 commit comments

Comments
 (0)