What's Changed
- Union types by @hungthai1401 in #20
Full Changelog: v1.2.0...v1.3.0
Extended Docs
use Strictus\Enums\Type;
$unionTypesVariable = Strictus::union([Type::INT, Type::STRING], 'foo');
echo $unionTypesVariable->value; //foo
echo $unionTypesVariable(); //foo
// Update variable
$unionTypesVariable->value = 100;
echo $unionTypesVariable->value; //100
// Thrown an exception if the value is wrong union types
$unionTypesVariable->value = false; //StrictusTypeException