本文整理匯總了PHP中Phan\Language\UnionType::asExpandedTypes方法的典型用法代碼示例。如果您正苦於以下問題:PHP UnionType::asExpandedTypes方法的具體用法?PHP UnionType::asExpandedTypes怎麽用?PHP UnionType::asExpandedTypes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Phan\Language\UnionType
的用法示例。
在下文中一共展示了UnionType::asExpandedTypes方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: canCastToExpandedUnionType
/**
* @param UnionType $target
* The type we'd like to see if this type can cast
* to
*
* @param CodeBase $code_base
* The code base used to expand types
*
* @return bool
* Test to see if this type can be cast to the
* given type after expanding both union types
* to include all ancestor types
*/
public function canCastToExpandedUnionType(UnionType $target, CodeBase $code_base) : bool
{
$this_expanded = $this->asExpandedTypes($code_base);
$target_expanded = $target->asExpandedTypes($code_base);
return $this_expanded->canCastToUnionType($target_expanded);
}