Do shortcodes on the given value.

@param  bool  $_
@param  mixed  $value
@return mixed
545444
protected function runShortcodes($_, $value)
    {
        if (! is_string($value)) {
            throw new RunnerException(
                'Cannot do shortcode on value of type '.gettype($value)
            );
        }

        return do_shortcode($value);
    }
354192
protected function translateShorthand(&$value)
    {
        // $value is an array but not an array of Entity(s)
        if(is_array($value) && !current($value) instanceof Entity){

            $this->array_walk($value, [$this, '_translate']);
        }
    }
881602
public function encodeValue($value)
    {
        if ($this->urlEncode == self::RFC_3986) {
            return rawurlencode($value);
        } elseif ($this->urlEncode == self::FORM_URLENCODED) {
            return urlencode($value);
        } else {
            return (string) $value;
        }
    }
392525
private function phpEncodeValue($value)
    {
        if (is_array($value)) {
            return $this->phpEncodeArray($value);
        }

        if (is_string($value)) {
            return json_encode($value);
        }

        return var_export($value, true);
    }
87917
private static function stringify($value)
    {
        if (is_string($value)) {
            return sprintf('"%s"', preg_replace('/\n/', '\n', $value));
        }

        if (is_bool($value)) {
            return $value ? 'true' : 'false';
        }

        if (is_null($value)) {
            return 'null';
        }

        if (is_array($value)) {
            return sprintf('[%s]', implode(', ', array_map(
                function ($value) {
                    return self::stringify($value);
                },
                $value
            )));
        }

        return (string) $value;
    }
915292
public static function regon($value)
    {
        $value = preg_replace('#[\\s-]#', '', $value);
        $length = strlen($value);

        if (!($length === 9 || $length === 14)) {
            return false;
        }

        $arrSteps = [8, 9, 2, 3, 4, 5, 6, 7];
        $intSum = 0;

        foreach ($arrSteps as $key => $step) {
            $intSum += $step * $value[$key];
        }

        $int = $intSum % 11;
        $intControlNr = ($int === 10) ? 0 : $int;

        return (string)$intControlNr === $value[8];
    }
431178
public static function toBooleanValue(string $value): bool
    {
        if (empty($value)) {
            return false;
        }
        
        return !in_array(strtolower(trim($value)), StringUtils::FALSES);
    }
1080329
private static function getRawCardValueFromShortFaceName($value)
    {
        $cardValue = ucfirst($value);

        foreach (static::$faceCardShortNames as $key => $symbol) {
            if ($symbol === $cardValue) {
                return $key;
            }
        }

        throw CardException::invalidCardString($value);
    }
726453
public function callShortcode($tag, $attributes, $content, $extra = array())
    {
        if (!$tag || !isset($this->shortcodes[$tag])) {
            return false;
        }
        return call_user_func($this->shortcodes[$tag], $attributes, $content, $this, $tag, $extra);
    }
360741
function prepValueForDB($value) {
		if(!$this->nullifyEmpty && $value === '') {
			return DB::getConn()->prepStringForDB($value);
		} else {
			return parent::prepValueForDB($value);
		}
	}
1167852
public function set($value = null)
    {
        $this->owner->set($this->short_name, $value);

        return $this;
    }
651521
public static function stripslashesDeep($value)
    {
        $value = is_array($value) ?
                    array_map(array('StringUtils', 'stripslashesDeep'), $value) :
                    stripslashes($value);

        return $value;
    }
583070
function match_code( $value ) {
		$code = parent::match_code( '' ) ;
		return $value ? $code->replace( array( 'FAIL' => NULL )) : $code ;
	}
127544
protected static function _doShortcode($m)
    {
        // allow {{foo}} syntax for escaping a tag
        if ($m[1] == '{' && $m[6] == '}') {
            return substr($m[0], 1, -1);
        }

        $tag = $m[2];
        $atts = static::_parseAttributes($m[3]);
        $listeners = EventDispatcher::instance('Shortcode')
            ->eventManager()
            ->listeners($tag);

        if (!empty($listeners)) {
            $options = [
                'atts' => (array)$atts,
                'content' => null,
                'tag' => $tag
            ];

            if (isset($m[5])) {
                $options['content'] = $m[5];
            }

            $result = EventDispatcher::instance('Shortcode')
                ->triggerArray([$tag, static::cache('context')], $options)
                ->result;

            return $m[1] . $result . $m[6];
        }

        return '';
    }
713665
protected function getDefaultValue($value)
    {
        if ($value instanceof Expression) {
            return $value;
        }

        return is_bool($value)
                    ? "'".(int) $value."'"
                    : "'".(string) $value."'";
    }
696172
static public function keywords($value=null)
    {
        if ($value) {
            $value = StringHelper::str_cut(strip_tags($value), 100);
        }
        
        return static::input(trim($value));
    }
715096
public function toDbValue($value)
    {
        if ($this->isString($value)) {
            return $this->quoteIfNecessary($value);
        }

        // smelly code. Refactor

        if ($value === true) {
            return 'TRUE';
        }

        if ($value === false) {
            return 'FALSE';
        }

        if ($value === null) {
            return 'NULL';
        }

        if (is_array($value)) {
            if (isset($value['value'])) {
                return $value['value'];
            }
        }

        return $value;
    }