Skip to content

Commit aea1cba

Browse files
authored
Merge pull request vimeo#7217 from weirdan/restore-constant-attributes-storage
2 parents 18c790e + 08413d7 commit aea1cba

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,6 +1296,19 @@ private function visitClassConstDeclaration(
12961296
}
12971297

12981298
$constant_storage->description = $description;
1299+
1300+
foreach ($stmt->attrGroups as $attr_group) {
1301+
foreach ($attr_group->attrs as $attr) {
1302+
$constant_storage->attributes[] = AttributeResolver::resolve(
1303+
$this->codebase,
1304+
$this->file_scanner,
1305+
$this->file_storage,
1306+
$this->aliases,
1307+
$attr,
1308+
$this->storage->name ?? null
1309+
);
1310+
}
1311+
}
12991312
}
13001313
}
13011314

src/Psalm/Storage/ClassConstantStorage.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ class ClassConstantStorage
3939
*/
4040
public $deprecated = false;
4141

42+
/**
43+
* @var list<AttributeStorage>
44+
* @psalm-suppress PossiblyUnusedProperty
45+
*/
46+
public $attributes = [];
47+
4248
/**
4349
* @var ?string
4450
*/

0 commit comments

Comments
 (0)