Jade\Compiler\CompilerUtils::escapeIfNeeded PHP Method

escapeIfNeeded() protected method

Return PHP code wich wrap the given value and escape it if $escaped is true.
protected escapeIfNeeded ( boolean $escaped, mixed $value ) : callable
$escaped boolean need to be escaped
$value mixed to be escaped if $escaped is true
return callable
    protected function escapeIfNeeded($escaped, $value)
    {
        $value = rtrim($value, ';');
        if ($escaped) {
            return $this->createCode(static::ESCAPED, $value, var_export($this->quote, true));
        }
        return $this->createCode(static::UNESCAPED, $value);
    }