diff --git a/CHANGELOG.md b/CHANGELOG.md index d21497f2..0fe6dca2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## v0.29.3 + +### Fixed + +- Fix namespace printing with `nette/php-generator:^4.1.1` + ## v0.29.2 ### Fixed diff --git a/examples/custom-types/expected/Operations/MyBenSampoEnumQuery.php b/examples/custom-types/expected/Operations/MyBenSampoEnumQuery.php index 878cb860..eb8e9349 100644 --- a/examples/custom-types/expected/Operations/MyBenSampoEnumQuery.php +++ b/examples/custom-types/expected/Operations/MyBenSampoEnumQuery.php @@ -1,6 +1,4 @@ -name = $classType->getName() . '.php'; - $file->content = self::asPhpFile($classType); + $file->content = self::asPhpFile($classType, $phpNamespace); return $file; } @@ -144,18 +145,16 @@ public static function after(string $subject, string $search): string return array_reverse($parts)[0]; } - protected static function asPhpFile(ClassType $classType): string + protected static function asPhpFile(ClassType $classType, PhpNamespace $namespace): string { $printer = new PsrPrinter(); - $phpNamespace = $classType->getNamespace(); - $class = $printer->printClass($classType, $phpNamespace); return <<getName()}; + + {$printer->printClass($classType, $namespace)} PHP; }