public final function describeMismatch($item, Hamcrest_Description $mismatchDescription)
 {
     if (!$this->_isSafeType($item)) {
         parent::describeMismatch($item, $mismatchDescription);
     } else {
         $this->describeMismatchSafely($item, $mismatchDescription);
     }
 }
Example #2
0
 public function describeMismatch($item, Hamcrest_Description $description)
 {
     if (!$this->_not) {
         $description->appendText('was not set');
     } else {
         $property = $this->_property;
         if (is_array($item)) {
             $value = $item[$property];
         } elseif (is_object($item)) {
             $value = $item->{$property};
         } elseif (is_string($item)) {
             $value = $item::${$property};
         }
         parent::describeMismatch($value, $description);
     }
 }