returns a textual description of given value

@param   \SebastianBergmann\Exporter\Exporter  $exporter
@param   mixed                                 $value
@return  string
504792
public function describeValue(Exporter $exporter, $value): string
    {
        $refMethod = new \ReflectionMethod(get_class($this->constraint), 'failureDescription');
        $refMethod->setAccessible(true);
        return $refMethod->invoke($this->constraint, $value);
    }
1073776
protected function parsePropertyValue($value)
    {
        $return = '';

        if (is_array($value)) {
            $withStringIndex = (bool) array_filter(array_keys($value), 'is_string');

            if ($withStringIndex) {
                $return = preg_replace(
                    ['/^(array ?\( *)/', '/\)$/'],
                    ['[', ']'],
                    str_replace("\n", '', var_export($value, true))
                );
            } else {
                $return =
                    '[' .
                    rtrim(
                        array_reduce(
                            $value,
                            function ($combined, $single) {
                                return $combined . var_export($single, true) . ', ';
                            },
                            ''
                        ),
                        ', '
                    ) .
                    ']';
            } // else
        } else {
            $return = var_export($value, true);
        } // else

        return $return;
    }
266330
protected function _render_export_item($field, $value, $primary_val, $row)
    {
        $out = '';
        if (isset($this->relation[$field]))
        {
            $value = strip_tags($row['rel.' . $field]);
        }
        if (isset($this->column_callback[$field]))
        {
            $path = $this->check_file($this->column_callback[$field]['path'], 'column_callback');
            include_once ($path);
            if (is_callable($this->column_callback[$field]['callback']) && $row)
            {
                $value = strip_tags(call_user_func_array($this->column_callback[$field]['callback'], array(
                    $value,
                    $field,
                    $primary_val,
                    $row,
                    $this)));
                return $value;
            }
        }

        if (isset($this->field_type[$field]))
        {
            switch ($this->field_type[$field])
            {
                case 'select':
                case 'radio':
                    $out .= $this->create_view_select($field, $value);
                    break;
                case 'multiselect':
                case 'checkboxes':
                    $out .= $this->create_view_multiselect($field, $value);
                    break;
                case 'timestamp':
                case 'datetime':
                    if ($value)
                    {
                        $out .= $this->mysql2datetime($value);
                    }
                    break;
                case 'date':
                    if ($value)
                    {
                        $out .= $this->mysql2date($value);
                    }
                    break;
                case 'time':
                    if ($value)
                    {
                        $out .= $this->mysql2time($value);
                    }
                    break;
                case 'price':
                    $out .= $this->cast_number_format($value, $field);
                    break;
                case 'bool':
                    $out .= $value ? $this->lang('bool_on') : $this->lang('bool_off');
                    break;
                case 'file':
                case 'image':
                    if (isset($this->upload_config[$field]['blob']))
                    {
                        $out .= $value ? '[binary data]' : '';
                    }
                    else
                    {
                        $out .= isset($this->upload_config[$field]['text']) ? $this->upload_config[$field]['text'] : $value;
                    }
                    break;
                case 'remote_image':
                    $out .= $value;
                    break;
                case 'binary':
                    $out .= $value ? '[binary data]' : '';
                    break;
                case 'text':
                case 'textarea':
                case 'texteditor':
                default:
                    $out .= $value;
                    break;
            }
        }
        else
        {
            $out .= $value;
        }
        if (isset($this->column_pattern[$field]))
        {
            $out = str_ireplace('{value}', $out, $this->column_pattern[$field]);
            $out = $this->replace_text_variables($out, $row, true);
            $out = strip_tags($out);
        }
        return $out;
    }
227251
protected static function getLocalizedDescription($value): ?string
    {
        if (static::isLocalizable())
        {
            $localizedStringKey = static::getLocalizationKey() . '.' . $value;

            if (Lang::has($localizedStringKey))
            {
                return __($localizedStringKey);
            }
        }

        return null;
    }
437123
public function describeValue(Exporter $exporter, $value): string
    {
        $valueDescription = '';
        if (null !== $this->violatingKey) {
            $valueDescription .= 'element '
             . $exporter->export($this->violatingValue)
             . ' at key ' . $this->violatingKey . ' ';
        }

        return $valueDescription .  'in ' . $exporter->export($value);
    }
800771
public function parseString($value) {
    if (is_string($value)) {
      return $value;
    }

    $exportValue = var_export($value, true);
    throw new ParseException("'$exportValue' can not be parsed as a string");
  }
235347
public static function createMessage($value)
    {
        $newValue = $value . self::EOL;
        return
            self::CONTENT_LENGTH . ':' . strlen($newValue) . self::EOL
            . self::EOL
            . $newValue;
    }
1184871
protected function get_value_as_string( $value ) {

		if ( is_object( $value ) && ! in_array( '__toString', get_class_methods( $value ) ) ) {
			$value = get_class( $value ) . ' object';
		} else if ( is_array( $value ) ) {
			$value = var_export( $value, TRUE );
		}

		return (string) $value;
	}
1152847
public function transform($value): string
    {
        if (method_exists($value, 'toJson')) {
            return $value->toJson();
        }

        if ($value instanceof JsonSerializable || $value instanceof StdClass) {
            return json_encode($value);
        }

        if (! method_exists($value, '__toString')) {
            throw Untransformable::cannotTransformObject($value);
        }

        return "'{$value}'";
    }
1135924
public function transform($value)
    {
        if (null === $value) {
            return "";
        }

        if (false === $value instanceof NodeTranslation) {
            throw new TransformationFailedException("Value must be instance of NodeTranslation");
        }

        return $this->router->generate('_slug', [
            '_locale' => $value->getLang(),
            'url' => $value->getUrl(),
        ]);
    }
681435
public static function exportVar($value)
    {
        $closures = self::collectClosures($value);
        $res = var_export($value, true);
        if (!empty($closures)) {
            $subs = [];
            foreach ($closures as $key => $closure) {
                $subs["'" . $key . "'"] = self::dumpClosure($closure);
            }
            $res = strtr($res, $subs);
        }

        return $res;
    }
1155617
public function serialize($value): string
    {
        if ($value instanceof Carbon) {
            return $value->toDateString();
        }

        return $this->tryParsingDate($value, InvariantViolation::class)
            ->toDateString();
    }
446
public static function export($value)
	{
		if (!is_scalar($value))
		{
			throw new InvalidArgumentException(__METHOD__ . '() cannot export non-scalar values');
		}
		if (is_int($value))
		{
			return (string) $value;
		}
		if (is_float($value))
		{
			// Avoid locale issues by using sprintf()
			return preg_replace('(\\.?0+$)', '', sprintf('%F', $value));
		}

		return self::exportString((string) $value);
	}
829765
public static function export($value, $tabs = 2)
    {
        // Custom array exporting
        if (is_array($value)) {
            $indent = str_repeat("\t", $tabs);
            $closingIndent = str_repeat("\t", $tabs - 1);
            $keys = array_keys($value);
            $array = array_map(function ($value, $key) use ($tabs) {
                if (is_numeric($key)) {
                    return static::export($value, $tabs + 1);
                }

                return "'$key' => ".static::export($value, $tabs + 1);
            }, $value, $keys);

            return "[\n$indent".implode(",\n$indent", $array)."\n$closingIndent]";
        }

        // Default variable exporting
        return var_export($value, true);
    }
881112
public function serialize($value): string
    {
        $id = $this->entityManager->getClassMetadata($this->className)->getIdentifierValues($value);

        return (string) reset($id);
    }
220562
protected function export_for_template_text(\mod_forum_renderer $renderer) {
        $data = $this->export_for_template_shared($renderer);
        return $data + array(
            'id'                            => html_entity_decode($this->post->id),
            'coursename'                    => html_entity_decode($this->get_coursename()),
            'courselink'                    => html_entity_decode($this->get_courselink()),
            'forumname'                     => html_entity_decode($this->get_forumname()),
            'showdiscussionname'            => html_entity_decode($this->get_showdiscussionname()),
            'discussionname'                => html_entity_decode($this->get_discussionname()),
            'subject'                       => html_entity_decode($this->get_subject()),
            'authorfullname'                => html_entity_decode($this->get_author_fullname()),
            'postdate'                      => html_entity_decode($this->get_postdate()),

            // Format some components according to the renderer.
            'message'                       => html_entity_decode($renderer->format_message_text($this->cm, $this->post)),
            'attachments'                   => html_entity_decode($renderer->format_message_attachments($this->cm, $this->post)),

            'canreply'                      => $this->canreply,
            'permalink'                     => $this->get_permalink(),
            'firstpost'                     => $this->get_is_firstpost(),
            'replylink'                     => $this->get_replylink(),
            'unsubscribediscussionlink'     => $this->get_unsubscribediscussionlink(),
            'unsubscribeforumlink'          => $this->get_unsubscribeforumlink(),
            'parentpostlink'                => $this->get_parentpostlink(),

            'forumindexlink'                => $this->get_forumindexlink(),
            'forumviewlink'                 => $this->get_forumviewlink(),
            'discussionlink'                => $this->get_discussionlink(),

            'authorlink'                    => $this->get_authorlink(),
            'authorpicture'                 => $this->get_author_picture($renderer),

            'grouppicture'                  => $this->get_group_picture($renderer),
        );
    }
373443
public function serialize($value): string
    {
        if ($value instanceof Carbon) {
            return $value->toDateTimeString();
        }

        return $this
            ->tryParsingDateTime($value, InvariantViolation::class)
            ->toDateTimeString();
    }