QuackCompiler\Types\Type::isExactlySameAs PHP Method

isExactlySameAs() public method

public isExactlySameAs ( Type $other )
$other Type
    public function isExactlySameAs(Type $other)
    {
        if ($this->hasSubType() && $other->hasSubtype()) {
            if ($this->code !== $other->code) {
                return false;
            }
            switch ($this->code) {
                case NativeQuackType::T_LIST:
                    return $this->subtype->isExactlySameAs($other->subtype);
                case NativeQuackType::T_MAP:
                    return $this->subtype['key']->isExactlySameAs($other->subtype['key']) && $this->subtype['value']->isExactlySameAs($other->subtype['value']);
                default:
                    return false;
            }
        }
        return $this->code === $other->code;
    }