-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
It would be great if you created a helper package for PHPUnit that can assert the type of a given value.
For example:
final class Branch
{
/**
* @param T $item
* @param list<Branch<T>> $children
* @param Branch<T>|null $parent
*/
public function __construct(
public object $item,
public array $children = [],
public ?Branch $parent = null,
) {}
}
self::assertType('Branch<Edge>', $branch);
This function will check that inside the Branch $branch
, in a property of type T
, there is an exactly Edge
. The same about other fields
Metadata
Metadata
Assignees
Labels
No labels