Skip to content

Commit f32c76e

Browse files
committed
Accept array type in Assurance attribute for ::class support
The type parameter now accepts string|array|null. Array form is a union of its elements, enabling ::class references for IDE navigation: #[Assurance(type: ['array', Countable::class])] String form remains unchanged for primitive-only types: #[Assurance(type: 'int|float|numeric-string')]
1 parent 21e9936 commit f32c76e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/Attributes/Assurance.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@
1515
#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)]
1616
final readonly class Assurance
1717
{
18-
/** @param array{int, int|null}|null $composeRange */
18+
/**
19+
* @param string|list<string>|null $type
20+
* @param array{int, int|null}|null $composeRange
21+
*/
1922
public function __construct(
20-
public string|null $type = null,
23+
public string|array|null $type = null,
2124
public AssuranceFrom|null $from = null,
2225
public AssuranceCompose|null $compose = null,
2326
public array|null $composeRange = null,

0 commit comments

Comments
 (0)