Pinq\Analysis\ITypeSystem::getCommonAncestorType PHP Метод

getCommonAncestorType() публичный Метод

Gets of a common ancestor type of the supplied types.
public getCommonAncestorType ( Pinq\Analysis\IType $type, Pinq\Analysis\IType $otherType ) : Pinq\Analysis\IType
$type Pinq\Analysis\IType
$otherType Pinq\Analysis\IType
Результат Pinq\Analysis\IType
    public function getCommonAncestorType(IType $type, IType $otherType);

Usage Example

Пример #1
0
 public function visitTernary(O\TernaryExpression $expression)
 {
     $this->walk($expression->getCondition());
     $this->walk($expression->getIfTrue());
     $this->walk($expression->getIfFalse());
     $this->analysis[$expression] = $this->typeSystem->getCommonAncestorType($this->analysis[$expression->hasIfTrue() ? $expression->getIfTrue() : $expression->getCondition()], $this->analysis[$expression->getIfFalse()]);
 }