(Componere 2 >= 2.1.2)
Componere\cast — 类型转换
$type, $object): 类型type用户定义类型
object一个具有用户定义类型且与 Type 兼容的对象
类型为 Type 的 对象,由 object 转换而来
如果 object 的类型是或派生自内部类,则将抛出 InvalidArgumentException
如果 Type 是一个接口,则将抛出 InvalidArgumentException
如果 Type 是一个 trait,则将抛出 InvalidArgumentException
如果 Type 是一个抽象类,则将抛出 InvalidArgumentException
如果 Type 与 object 的类型不兼容,则将抛出 InvalidArgumentException