tempest-framework
tempest-framework copied to clipboard
feat(mapper): support union types in docblocks
This pull request adds support for union types along with partially-understanding types defined in docblock.
class StoreRequest {
/** @var string|string[] */
public string|array $tags;
}
mixed type is also supported
class StoreRequest {
/** @var string|mixed[] */
public string|array $tags;
}
This means that it is now also supported.
class StoreRequest {
/** $var string[] */
public array $tags;
}
There are still a few edge cases to resolve, but I would say this is MVP.
Looks promising!