Closed MaximilianSpeer closed 2 years ago
Version: 3.6.7
The PhpParser ignores a comment if it's in the first line of a method. This occurses when using PhpFile::fromCode()
`$code = "<?php
class TestClass { function aFunction() { // a Comment \$foo = 'bar'; // another Comment } }";
$file = PhpFile::fromCode($code); $newCode = (string) $file; echo $newCode; return;`
The first comment should get extracted from the code and stored in the PhpFile object.
Version: 3.6.7
Bug Description
The PhpParser ignores a comment if it's in the first line of a method. This occurses when using PhpFile::fromCode()
Steps To Reproduce
`$code = "<?php
$file = PhpFile::fromCode($code); $newCode = (string) $file; echo $newCode; return;`
Expected Behavior
The first comment should get extracted from the code and stored in the PhpFile object.