Skip to content

Commit

Permalink
Minor fixes (#1033)
Browse files Browse the repository at this point in the history
* Improve docblock typehints
* Handle attachables in `Examples`
  • Loading branch information
DerManoMann authored Dec 20, 2021
1 parent 009b835 commit db7c984
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Annotations/AbstractAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ abstract class AbstractAnnotation implements \JsonSerializable
/**
* Arbitrary attachables for this annotation.
* These will be ignored but can be used for custom processing.
*
* @var array
*/
public $attachables = Generator::UNDEFINED;

Expand Down Expand Up @@ -271,6 +273,8 @@ public function __debugInfo()

/**
* Customize the way json_encode() renders the annotations.
*
* @return mixed
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
Expand Down
3 changes: 3 additions & 0 deletions src/Annotations/Examples.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ public function __construct(
'ref' => $ref,
'x' => $x ?? Generator::UNDEFINED,
]);
if ($attachables) {
$this->merge([$attachables]);
}
}
}
} else {
Expand Down

0 comments on commit db7c984

Please sign in to comment.