Returns a PHP representation of a given value.

@param mixed $value The value to convert

@return $this
18546
public function repr($value)
    {
        if (\is_int($value) || \is_float($value)) {
            if (false !== $locale = setlocale(LC_NUMERIC, 0)) {
                setlocale(LC_NUMERIC, 'C');
            }

            $this->raw($value);

            if (false !== $locale) {
                setlocale(LC_NUMERIC, $locale);
            }
        } elseif (null === $value) {
            $this->raw('null');
        } elseif (\is_bool($value)) {
            $this->raw($value ? 'true' : 'false');
        } elseif (\is_array($value)) {
            $this->raw('[');
            $first = true;
            foreach ($value as $key => $value) {
                if (!$first) {
                    $this->raw(', ');
                }
                $first = false;
                $this->repr($key);
                $this->raw(' => ');
                $this->repr($value);
            }
            $this->raw(']');
        } else {
            $this->string($value);
        }

        return $this;
    }
1175183
public function transform($value)
    {
        if (!$value instanceof Value) {
            return '';
        }

        return $this->docbookToXhtml5EditConverter->convert($value->xml)->saveXML();
    }
849952
public function setValue($value)
    {
        $this->value = ($value) ? self::TRUE : self::FALSE;

        return $this;
    }
899160
public function setValue($value)
    {
        if (!is_array($value)) {
            $value = [];
        }
        foreach ($value as $key => $value) {
            $element = $this->getElement($key);
            if (!$element) {
                $this->setElement($key, ['value' => $value]);
            } else {
                $element->setValue($value);
            }
        }

        return $this;
    }
1320150
public function val($value = null)
    {
        if (!$this->isNull($value)) {
            $this->value = $value;

            return $this;
        }

        return $this->value;
    }
180954
private function decorateValue($value) : string
    {
        $ret = 'null';
        switch(gettype($value)){
            case 'string':
                $ret = $this->decorateStringValue($value);
                break;
            case 'integer':
            case 'double':
                $ret = $value;
                break;
            case 'boolean':
                $ret = $value ? 'true' : 'false';
                break;
            case 'array':
                $ret = $this->decorateArrayValue($value);
                break;
        }
        return $ret;
    }
1143349
public static function stringify($value)
    {
        if (is_string($value)) {
            return $value;
        }
        if ($value === null || is_bool($value)) {
            return var_export($value, true);
        }

        if (is_array($value) || (is_object($value) && !method_exists($value, '__toString'))) {
            return json_encode($value, JSON_ERROR_NONE | JSON_UNESCAPED_SLASHES);
        }
        return (string)$value;
    }
461696
public static function toString($value)
    {
        if (is_null($value)) {
            $ret = 'null';
        } elseif (is_bool($value)) {
            $ret = $value ? 'true' : 'false';
        } elseif (is_array($value)) {
            $ret = '[' . implode(',', $value) . ']';
        } else if ((!is_object($value) && settype($value, 'string') !== false)
            || (is_object($value) && method_exists($value, '__toString'))
        ) {
            $ret = '' . $value;
        } else {
            $ret = '[no string representation]';
        }

        return $ret;
    }
1323206
public function displayValue( $value )
    {
        if ( isset( $this->values[$value] ) )
        {
            $value = $this->values[$value];
        }

        if ( $this->translationEnabled )
        {
            $value = parent::displayValue( $value );
        }

        return $value;
    }
562448
public function transform($value)
    {
        if ($value instanceof JsonSerializable || $value instanceof StdClass) {
            return json_encode($value);
        }

        // If a toJson() method exists, the object can cast itself automatically.
        if (method_exists($value, 'toJson')) {
            return $value;
        }

        // Otherwise, if the object doesn't even have a __toString() method, we can't proceed.
        if (! method_exists($value, '__toString')) {
            throw new \Exception('Cannot transform this object to JavaScript.');
        }

        return "'{$value}'";
    }
821277
public function setValue($value)
    {
        NumericValidator::validate($value, "Value");
        $value = Formatter::formatToPrice($value, $this->getCurrency());
        $this->value = $value;
        return $this;
    }
1128373
public static function stringify($value)
    {
        $string = '';
        if (is_scalar($value)) {
            // integer, float, string, boolean
            $string = (string)$value;
        } elseif (is_resource($value)) {
            // resource
            $string = '[resource]';
        } else {
            // array, object, null, callable
            $string = json_encode($value);
        }
        return $string;
    }
428391
private function getTypedValue(string $value)
    {
        if (\in_array($value, self::$boolValues, true)) {
            return \in_array($value, self::$truthlyValues, true);
        }

        if (\is_numeric($value)) {
            return $this->getNumericValue($value);
        }

        return $value;
    }
470227
public function appendValue($value)
    {
        $appendValue = $this->formatValue($value);
        $this->message = $this->message . $appendValue;

        return $this;
    }
858208
public function value( $value = NULL ){
		if( is_null( $value ) )
			return $this->value;
		$this->value	= $value;
	}
804464
protected function buildValue($value)
    {
        if ($value instanceof Model || is_null($value)) {
            return $value;
        }

        $model = $this->attribute->getAttribute('type');
        $instance = new $model();

        $instance->setAttribute('entity_id', $this->entity->getKey());
        $instance->setAttribute('entity_type', get_class($this->entity));
        $instance->setAttribute($this->attribute->getForeignKey(), $this->attribute->getKey());
        $instance->setAttribute('content', $value);

        return $instance;
    }
331723
protected function formatValue($value)
    {
        if ($this->formatValue !== NULL) {
            return str_replace(static::VALUE_IDENTIFIER, $value, $this->formatValue);
        } else {
            return $value;
        }
    }