private function doUnexpectedValueError($element) { return new UnexpectedValueException(sprintf('"%s" does not match the expected type.', is_object($element) ? get_class($element) : gettype($element))); }