-
-
Notifications
You must be signed in to change notification settings - Fork 146
Closed
Description
Version: 4.0.6
Bug Description
The inline comment declared begin with //
besides constants get lost after fromCode
and printFile
Steps To Reproduce
$file = \Nette\PhpGenerator\PhpFile::fromCode(<<<'PHP'
<?php
class A {
public const HELLO = 'hello'; // some comment
public function say(string $to): string {
// just combine hello and $to
return static::HELLO . ' ' . $to;
}
}
PHP
);
echo (new \Nette\PhpGenerator\PsrPrinter())->printFile($file);
Actual Result
<?php
class A
{
public const HELLO = 'hello';
public function say(string $to): string
{
// just combine hello and $to
return static::HELLO . ' ' . $to;
}
}
Expected Behavior
Keep the inline comment as well.
<?php
class A
{
public const HELLO = 'hello'; // some comment
public function say(string $to): string
{
// just combine hello and $to
return static::HELLO . ' ' . $to;
}
}
Metadata
Metadata
Assignees
Labels
No labels