@param string $string
@param string $type

@return string
550971
protected function color($string, $type)
    {
        return $this->colourAdapter->colour(
            $string,
            $this->config->getColorForType($type)
        );
    }
107982
public function printMessage($string, $type = 'comment', $force = true): void
    {
        if ($this->isPrintable($force)) {
            echo $this->getMessageWithColor($string, $this->getMessageBackgroundColor($type));
            echo "\n";
        }
    }
1174635
public static function dumpType(string $type): string
    {
        if (self::isLikeName($type)) {
            return "<$type>";
        }
        return self::dumpInline($type);
    }
255712
public static function encode($data, String $type = 'unescapedUnicode') : String
    {
        return json_encode($data, Helper::toConstant($type, 'JSON_'));
    }
664522
public function getType(string $type): Type
    {
        if (isset($this->types[$type])) {
            return $this->types[$type];
        }

        $instance = $this->createType($type);
        $this->addType($instance);
        $this->types[$type] = $instance;

        return $instance;
    }
375162
public static function normalizeDataType(string $type): string
    {
        $searchType = strtolower($type);

        return array_key_exists($searchType, self::$normalizations) ? self::$normalizations[$searchType] : $type;
    }
979886
public static function getExtension(
        string $type,
        string $default = "unknown"
    ): string
    {
        return array_key_exists($type, self::$types)
            ? self::$types[$type]
            : $default;
    }
1251735
public static function char(String $string, String $type = 'char', String $changeType = 'html') : String
    {
        $options = ['char', 'html', 'hex', 'dec'];

        if( ! in_array($type, $options) || ! in_array($changeType, $options) )
        {
            throw new InvalidArgumentException('[Converter::char()] -> Available Options: [char], [html], [hex], [dec]  For 2.($type) & 3.($changeType)!');
        }

        if( $type === $changeType )
        {
            throw new LogicException('[Converter::char()] -> 2.($type) & 3.($changeType) parameters [can not be equal]!');
        }

        $string = self::accent($string);

        if( ! is_string($type) )
        {
            $type = 'char';
        }

        if( ! is_string($changeType) )
        {
            $changeType = 'html';
        }

        for( $i = 32; $i <= 255; $i++ )
        {
            $hexRemaining = ( $i % 16 );
            $hexRemaining = str_replace( [10, 11, 12, 13, 14, 15], ['A', 'B', 'C', 'D', 'E', 'F'], $hexRemaining );
            $hex          = ( floor( $i / 16) ).$hexRemaining;

            if( $hex[0] == '0' )
            {
                $hex = $hex[1];
            }

            if( chr($i) !== ' ' )
            {
                $chars['char'][] = chr($i);
                $chars['dec'][]  = $i." ";
                $chars['hex'][]  = $hex." ";
                $chars['html'][] = "&#{$i};";
            }
        }

        return str_replace( $chars[strtolower($type)], $chars[strtolower($changeType)], $string );
    }
766518
public static function decompressString( $content, $type = NULL )
	{
		if( !$type )
			return $content;
		ob_start();																					//  open a output buffer
		switch( strtolower( $type ) )
		{
			case 'deflate':
				$content	= self::inflate( $content );
				break;
			case 'gzip':
				xmp( $content );
				$content	= self::ungzip( $content );
				xmp( $content );
				break;
			default:
				ob_end_clean();
				throw new InvalidArgumentException( 'Decompression method "'.$type.'" is not supported' );
		}
		$output		= ob_get_clean();																//  close buffer for PHP error messages
		if( $content === FALSE && $output )															//  could not decompress
			throw new RuntimeException( $output );												//  throw exception and carry error message
		return $content;																				//  return decompressed response Content
	}
1337568
public function string($string = NULL)
	{
		if (func_num_args() === 0)
		{
			return $this->_string;
		}
		$this->_string = $string;
		return $this;
	}
800213
private function getNewExpiresDateString($type = 'short')
	{
		$modifier = $this->config[$type]['period'];
		return with(new Date('now'))->modify('+' . $modifier . ' MINUTES')->toSql();
	}
1732
public function quote($string, $parameter_type = \PDO::PARAM_STR): string {
        return $this->connection->quote($string, $parameter_type);
    }
1171183
public static function toString($type)
    {
        if (! isset(self::$strings[$type])) {
            return $type;
        }
        return self::$strings[$type];
    }
973327
public function random($length = 32, $type = self::RAND_ALL)
    {
        $string = '';

        // todo: make to halper?
        foreach ($this->dictionary as $pos => $item)
        {
            $key = (1 << $pos);
            if ($type >= $key)
            {
                $string .= $item;
                $type -= $key;
            }
        }

        if (empty($string))
        {
            throw new \InvalidArgumentException("Invalid random string type [{$type}].");
        }

        return $this->rand($string, $length);
    }
463385
protected function formatType($type)
    {
        if (preg_match('/^(?:(.*)\.)?_(.*)$/', $type, $matches)) {
            if ($matches[1] !== '') {
                return sprintf("%s.%s[]", $matches[1], $matches[2]);
            } else {
                return $matches[2].'[]';
            }
        } else {
            return $type;
        }
    }
1339199
public function parseString($string)
    {
        $string = (string) $string;
        $string = preg_replace_callback("/\\$\{(.*?)\}/",
            function ($k) {
                return $this->get($k[1]);
            }, $string);

        return $string;
    }
536018
public static function strtolower($string): string
    {
        if (in_array(self::$locale->language()->code(), self::DOTLESS_I_LOCALES, true)) {
            $string = strtr($string, self::DOTLESS_I_TOLOWER);
        }

        return mb_strtolower($string);
    }