Exemplo n.º 1
0
 public function testForEquality(PhpType $that)
 {
     if ($that->isFalse()) {
         return TernaryValue::get('true');
     }
     return parent::testForEquality($that);
 }
 public function testForEquality(PhpType $that)
 {
     if (null !== ($rs = parent::testForEquality($that))) {
         return $rs;
     }
     if ($that->isNoObjectType()) {
         return TernaryValue::get('unknown');
     }
     if (null === ($objType = $that->toMaybeObjectType())) {
         return TernaryValue::get('false');
     }
     if (strtolower($objType->name) !== strtolower($this->name)) {
         return TernaryValue::get('false');
     }
     return TernaryValue::get('unknown');
 }
Exemplo n.º 3
0
 public function canTestForEqualityWith(PhpType $that)
 {
     return $this->testForEquality($that) === TernaryValue::get('unknown');
 }