Skip to content

Commit

Permalink
Reflect trait @use PHPDoc in classes without a class-level PHPDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
vudaltsov committed Aug 5, 2024
1 parent 05cc05f commit 47049f4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed

- Reflect trait @use PHPDoc in classes without a class-level PHPDoc.
2 changes: 1 addition & 1 deletion Internal/PhpDoc/PhpDocReflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public function processClass(NamedClassId|AnonymousClassId $id, TypedMap $data,
$context = $data[Data::Context];

$data = $data
->with(Data::UnresolvedTraits, $this->reflectUses($context, $data))
->with(Data::Constants, array_map(
fn(TypedMap $constant): TypedMap => $this->reflectNativeConstant($context, $constant),
$data[Data::Constants],
Expand Down Expand Up @@ -151,7 +152,6 @@ public function processClass(NamedClassId|AnonymousClassId $id, TypedMap $data,
->with(Data::Aliases, $this->reflectAliases($context, $phpDoc))
->with(Data::UnresolvedParent, $this->reflectParent($context, $data, $phpDoc))
->with(Data::UnresolvedInterfaces, $this->reflectInterfaces($context, $data, $phpDoc))
->with(Data::UnresolvedTraits, $this->reflectUses($context, $data))
->with(Data::Properties, [
...$data[Data::Properties],
...$this->reflectPhpDocProperties($context, $phpDoc->propertyTags()),
Expand Down

0 comments on commit 47049f4

Please sign in to comment.