Skip to content

Commit e74e5b1

Browse files
committed
Extractor: fixed extracting attributes [Closes #98]
1 parent e973ad0 commit e74e5b1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/PhpGenerator/Extractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ private function addCommentAndAttributes($element, Node $node): void
359359
foreach ($group->attrs as $attribute) {
360360
$args = [];
361361
foreach ($attribute->args as $arg) {
362-
$value = new Literal($this->getReformattedContents([$arg], 0));
362+
$value = new Literal($this->getReformattedContents([$arg->value], 0));
363363
if ($arg->name) {
364364
$args[$arg->name->toString()] = $value;
365365
} else {

tests/PhpGenerator/expected/Extractor.classes.80.expect

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Class8
1515
* Description of class.
1616
*/
1717
#[\ExampleAttribute]
18-
#[NamedArguments(foo: foo: 'bar', bar: bar: [1, 2, 3])]
18+
#[NamedArguments(foo: 'bar', bar: [1, 2, 3])]
1919
class Class9
2020
{
2121
/** Commented */

0 commit comments

Comments
 (0)