You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The inline comment declared begin with // besides constants get lost after fromCode and printFile
Steps To Reproduce
$file = \Nette\PhpGenerator\PhpFile::fromCode(<<<'PHP'
<?phpclass 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
<?phpclassA
{
publicconstHELLO = 'hello';
publicfunctionsay(string$to): string
{
// just combine hello and $toreturnstatic::HELLO . '' . $to;
}
}
Expected Behavior
Keep the inline comment as well.
<?phpclassA
{
publicconstHELLO = 'hello'; // some commentpublicfunctionsay(string$to): string
{
// just combine hello and $toreturnstatic::HELLO . '' . $to;
}
}
The text was updated successfully, but these errors were encountered:
Version: 4.0.6
Bug Description
The inline comment declared begin with
//
besides constants get lost afterfromCode
andprintFile
Steps To Reproduce
Actual Result
Expected Behavior
Keep the inline comment as well.
The text was updated successfully, but these errors were encountered: