-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Hello!
First off, thank you for your work here. It's saved me many hours of figuring out how to do this myself 😄
I am trying to build a small program to generate PHPUnit tests based off of the class, right now the only thing really preventing me from implementing anything is having the leadingComments supported
"leadingComments": [
{
"kind": "commentblock",
"value": "/**\n * Class " + classObject.name + 'Test' + "\n * @package Tests\\Unit\\Console\\Commands\\ADFRequest\n */"
}
],
My company uses declare(strict_types=1);
and has a comment above it for a file comment and right now the unparser doesn't support any kind of leading comments.
Here is what the parser generates:
{
"kind": "program",
"children": [
{
"kind": "declare",
"leadingComments": [
{
"kind": "commentblock",
"value": "/**\n * Tests the class\n */"
}
],
"children": [],
"what": {
"strict_types": {
"kind": "number",
"value": "1"
}
},
"mode": "none"
},
// Other class item
]
}
And in PHP it would look like this:
<?php
/**
* Tests the class
*/
declare(strict_types=1);
Adding support for the leading comments would be deeply appreciated.
Metadata
Metadata
Assignees
Labels
No labels