@param string $data

@return string
162059
public function decrypt($data)
    {
        return openssl_decrypt($data, $this->algorithm, $this->secret, 0, $this->iv);
    }
582948
protected function _toString($data) {
		foreach ($data as $key => $val) {
			switch (true) {
				case is_object($val) && !$val instanceof \Closure:
					try {
						$data[$key] = (string) $val;
					} catch (Exception $e) {
						$data[$key] = '';
					}
				break;
				case is_array($val):
					$data = array_merge($data, Set::flatten($val));
				break;
			}
		}
		return $data;
	}
183892
protected function encode($data)
    {
        if ($this->getEncoding() === self::ENCODING_BASE64) {
            return base64_encode(serialize($data));
        } else {
            return serialize($data);
        }
    }
1148135
protected function formatData(array $data) : string {
    $data_string = '';

    foreach ($data as $column => $value) {
      $data_string .= "`{$column}` = :{$column}";

      if (next($data) !== false) {
        $data_string .= ', ';
      }
    }

    return $data_string;
  }
1003335
protected function formatCallback($data)
    {
        if (\count($data) < 2) {
            return $data[0];
        }

        // simple auto or explicit placeholder
        if ($this->mode == self::MODE_INDEXED && $this->hasKey($data[1])) {
            $this->evaluateParam($data[1] || $this->pointer);
            return $this->getParam($data[1]);
        }

        // simple named, explicit placeholder
        elseif ($this->mode == self::MODE_NAMED && \strlen($data[1]) > 0 && $this->hasKey($data[1])) {
            $this->evaluateParam($data[1]);
            return $this->getParam($data[1]);
        }

        // keywords
        elseif (\preg_match('
            /
            ^
                @
                (class|classLong|method|methodLong|function|file|fileLong|dir|dirLong|line)
            $
            /x', $data[1], $match)
        ) {
            switch ($match[1]) {
                case 'classLong':
                    if (!$this->traceClass || !isset($this->traceClass['class'])) {
                        $msg = "Bad usage of @classLong keyword in {$this->traceFile['file']} on " .
                            "line {$this->traceFile['line']} (by m36\\StringFormatter)";
                        \trigger_error($msg, E_USER_WARNING);

                        return '';
                    }

                    return $this->traceClass['class'];
                case 'class':
                    if (!$this->traceClass || !isset($this->traceClass['class'])) {
                        $msg = "Bad usage of @class keyword in {$this->traceFile['file']} on " .
                            "line {$this->traceFile['line']} (by m36\\StringFormatter)";
                        \trigger_error($msg, E_USER_WARNING);

                        return '';
                    }

                    $cls = \explode('\\', $this->traceClass['class']);

                    return end($cls);
                case 'method':
                    if (!$this->traceClass || !isset($this->traceClass['class'])) {
                        $msg = "Bad usage of @method keyword in {$this->traceFile['file']} on " .
                            "line {$this->traceFile['line']} (by m36\\StringFormatter)";
                        \trigger_error($msg, E_USER_WARNING);

                        return '';
                    }

                    $cls = \explode('\\', $this->traceClass['class']);
                    $cls = \end($cls);

                    return $cls . '::' . $this->traceClass['function'];
                case 'methodLong':
                    if (!$this->traceClass || !isset($this->traceClass['class'])) {
                        $msg = "Bad usage of @methodLong keyword in {$this->traceFile['file']} on " .
                            "line {$this->traceFile['line']} (by m36\\StringFormatter)";
                        \trigger_error($msg, E_USER_WARNING);

                        return '';
                    }

                    return $this->traceClass['class'] . '::' . $this->traceClass['function'];
                case 'function':
                    if (!$this->traceClass || !isset($this->traceClass['function'])) {
                        $msg = "Bad usage of @function keyword in {$this->traceFile['file']} on " .
                            "line {$this->traceFile['line']} (by m36\\StringFormatter)";
                        \trigger_error($msg, E_USER_WARNING);

                        return '';
                    }

                    return $this->traceClass['function'];
                case 'file':
                    return \basename($this->traceFile['file']);
                case 'fileLong':
                    return $this->traceFile['file'];
                case 'dir':
                    return \basename(\dirname($this->traceFile['file']));
                case 'dirLong':
                    return \dirname($this->traceFile['file']);
                case 'line':
                    return $this->traceFile['line'];
            }
        }

        // text alignment
        elseif (\preg_match('
            /
            ^
                (' . self::$rxp_keys[$this->mode] . ')  # placeholder
                :                                       # explicit colon
                (.)?                                    # pad character
                ([<>^])                                 # alignment
                (\d+)                                   # pad length
            $
            /x', $data[1], $match) &&
            $this->hasKey($match[1])
        ) {
            $this->evaluateParam($match[1]);
            return \str_pad(
                $this->getParam($match[1]),
                $match[4],
                (\strlen($match[2]) > 0 ? $match[2] : ' '),
                static::$matrix__str_pad[$match[3]]
            );
        }

        // sprintf pattern
        elseif (\preg_match('
            /
            ^
                (' . self::$rxp_keys[$this->mode] . ')  # placeholder
                %                                       # explicit percent
                (.*)                                    # sprintf pattern
            $
            /x', $data[1], $match) &&
            $this->hasKey($match[1])
        ) {
            $this->evaluateParam($match[1]);
            return \vsprintf($match[2], $this->getParam($match[1]));
        }

        // call object method or get object property
        elseif (\preg_match('
            /
            ^
                (' . self::$rxp_keys[$this->mode] . ')  # placeholder
                ->                                      # explicit arrow
                (\w+)                                   # keyword (field or method name)
            $
            /x', $data[1], $match) &&
            $this->hasKey($match[1])
        ) {
            $this->evaluateParam($match[1]);
            $param = $this->getParam($match[1]);
            if (\method_exists($param, $match[2])) {
                return \call_user_func(array($param, $match[2]));
            } elseif (\property_exists($param, $match[2])) {
                return $param->{$match[2]};
            } elseif (\in_array('__call', \get_class_methods($param))) {
                return \call_user_func(array($param, $match[2]));
            } elseif (\in_array('__get', \get_class_methods($param))) {
                return $param->{$match[2]};
            } else {
                return $data[0];
            }
        }

        // converting int to other base
        elseif (\preg_match('
            /
            ^
            (' . self::$rxp_keys[$this->mode] . ')  # placeholder
            [#]                                     # explicit hash
            (?:
                (\d+)                               # source base
                [#]                                 # explicit hash
            )?
            ([dxXob]|\d\d?)                         # destination base
            $
            /x', $data[1], $match) &&
            $this->hasKey($match[1])
        ) {
            $this->evaluateParam($match[1]);
            $ret = \base_convert(
                $this->getParam($match[1]),                     // value to convert
                ($match[2] ? $match[2] : 10),                   // source base (defaults to 10)
                (
                \is_numeric($match[3])                          // destination base is:
                    ? $match[3]                                 // - numeric
                    : self::$matrix__base_convert[$match[3]]    // - or named
                )
            );
            if ($match[3] == 'X') {
                $ret = \strtoupper($ret);
            }

            return $ret;
        }

        // array index
        elseif (\preg_match('
            /
            ^
                (' . self::$rxp_keys[$this->mode] . ')  # placeholder
                \[                                      # opening square bracket
                    (\w+)                               # key
                \]                                      # closing square bracket
            $
            /x', $data[1], $match) &&
            $this->hasKey($match[1]) &&
            \is_array($ret = $this->getParam($match[1])) &&
            isset($ret[$match[2]])
        ) {
            $this->evaluateParam($match[1]);
            return $ret[$match[2]];
        }

        // unknown token
        else {
            $msg = "Unknown token found in format: {$data[0]} in {$this->traceFile['file']} on " .
                "line {$this->traceFile['line']} (by m36\\StringFormatter)";
            \trigger_error($msg, E_USER_WARNING);

            return $data[0];
        }
    }
563252
public function transform($data)
    {
        $output = $data;
        if (is_array($data)) {
            $output = "<ul>";
            foreach ($data as $item) {
                $output .= "<li>" . $this->transform($item) . "</li>";
            }
            $output .= "</ul>";
        }

        return $output;
    }
292090
public static function utf8Encode($data) {
		if (is_string($data)) {
			return utf8_encode($data);

		} else if (is_array($data)) {
			foreach ($data as $key => $value) {
				$data[utf8_encode($key)] = self::utf8Encode($value);
			}

		} else if (is_object($data)) {
			foreach ($data as $key => $value) {
				$data->{$key} = self::utf8Encode($value);
			}
		}

		return $data;
	}
344705
static public function decode($data)
	{
	    return json_decode($data, true) ? : ($data && $data!='\"\"' && $data !='false' ? $data : null);
	}
768184
protected static function dataToString($data)
    {
        if (!is_string($data))
        {
            try
            {
                $data = \GuzzleHttp\json_encode($data);
            }
            catch (\InvalidArgumentException $e)
            {

            }
        }

        return $data;
    }
1240560
public function encode($data) : string
    {
        $result = json_encode($data, $this->options, $this->maxDepth);

        $this->checkLastError();

        return $result;
    }
1113101
protected function getString($data)/*# : string */
    {
        if (is_scalar($data)) {
            return strval($data);
        } elseif (is_array($data)) {
            return 'ARRAY[' . count($data) . ']';
        } elseif (is_object($data)) {
            return $this->getObjectString($data);
        } else {
            return 'TYPE: ' . gettype($data);
        }
    }
528809
protected function convertEncoding($data)
    {
        if ($this->getEncodingInput() == $this->getEncodingOutput()) {
            return $data;
        }

        if (is_null($data)) {
            return $data;
        }

        if (is_array($data)) {
            foreach ($data as $key => $value) {
                $data[$key] = $this->convertEncoding($value);
            }

            return $data;
        }

        if ($this->getEncodingOutput() == 'UTF-8') {
            return utf8_encode($data);
        }

        return utf8_decode($data);
    }
1298062
public function decode(string $data): string
    {
        $this->validateInput($data);

        $data = str_split($data);
        $data = array_map(function ($character) {
            return strpos($this->options["characters"], $character);
        }, $data);

        $leadingZeroes = 0;
        while (!empty($data) && 0 === $data[0]) {
            $leadingZeroes++;
            array_shift($data);
        }

        $converted = $this->baseConvert($data, 62, 256);

        if (0 < $leadingZeroes) {
            $converted = array_merge(
                array_fill(0, $leadingZeroes, 0),
                $converted
            );
        }

        return implode("", array_map("chr", $converted));
    }
1077849
public function decode($data)
    {
        $data = \preg_replace('/[^0-9A-Fa-f]/', '', \rtrim($data, '>'));
        if ((\strlen($data) % 2) === 1) {
            $data .= '0';
        }

        return \pack('H*', $data);
    }
416124
public function encode(string $data): string
    {
        $data = str_split($data);
        $data = array_map("ord", $data);

        $leadingZeroes = 0;
        while (!empty($data) && 0 === $data[0]) {
            $leadingZeroes++;
            array_shift($data);
        }
        $converted = $this->baseConvert($data, 256, 62);
        if (0 < $leadingZeroes) {
            $converted = array_merge(
                array_fill(0, $leadingZeroes, 0),
                $converted
            );
        }
        return implode("", array_map(function ($index) {
            return $this->options["characters"][$index];
        }, $converted));
    }
758556
public function replaceParametersScalar($data)
	{
		$count = preg_match_all('/%[a-z\\._]+%/i', $data, $matches);

		if (!$count) {
			return $data;
		}

		$replacements = array();

		foreach ($matches as $expression) {
			$parameter = trim($expression[0], '%');
			$replacements[$expression[0]] = $this->getParameter($parameter);
		}

		return strtr($data, $replacements);
	}
4047
public function escape($data) {

		if(null === $data) {
			return $data;
		}

		if(false === is_string($data) && false === is_numeric($data)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, float or int, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
		}

		if(null === $this -> connection) {
			$this -> connect();
		}

		return $this -> connection -> real_escape_string($data);
	}