public function describeMismatch($item, Description $description) { $value = ''; 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); } }