Skip to content

Commit

Permalink
Extractor: fixed extracting attributes [Closes #98]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Nov 23, 2021
1 parent 63a10e5 commit a862204
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/PhpGenerator/Extractor.php
Expand Up @@ -359,7 +359,7 @@ private function addCommentAndAttributes($element, Node $node): void
foreach ($group->attrs as $attribute) {
$args = [];
foreach ($attribute->args as $arg) {
$value = new Literal($this->getReformattedContents([$arg], 0));
$value = new Literal($this->getReformattedContents([$arg->value], 0));
if ($arg->name) {
$args[$arg->name->toString()] = $value;
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/PhpGenerator/expected/Extractor.classes.80.expect
Expand Up @@ -15,7 +15,7 @@ class Class8
* Description of class.
*/
#[\ExampleAttribute]
#[NamedArguments(foo: foo: 'bar', bar: bar: [1, 2, 3])]
#[NamedArguments(foo: 'bar', bar: [1, 2, 3])]
class Class9
{
/** Commented */
Expand Down

0 comments on commit a862204

Please sign in to comment.