@param type $notation

@return string
770155
private function getNotationTypeArray($notation, &$params)
    {
        if ($notation && $notation == array_values($notation)) {
            $params['Default'] = isset($notation[0]) ? $notation[0] : null;

            return 'enum';
        }

        return 'schema';
    }
1005610
public static function formatMethod($frame)
    {
        if (!empty($frame['class']) && !empty($frame['type']) && !empty($frame['function'])) {
            return sprintf('%s%s%s()', $frame['class'], $frame['type'], $frame['function']);
        } else {
            return sprintf('%s()', !empty($frame['function']) ? $frame['function'] : '<unknown>');
        }
    }
1187983
public function type($type)
    {
        if (is_string($type)) {
            $map = array(
                'double' => 1,
                'string' => 2,
                'object' => 3,
                'array' => 4,
                'binary' => 5,
                'undefined' => 6,
                'objectid' => 7,
                'boolean' => 8,
                'date' => 9,
                'null' => 10,
                'regex' => 11,
                'jscode' => 13,
                'symbol' => 14,
                'jscodewithscope' => 15,
                'integer32' => 16,
                'timestamp' => 17,
                'integer64' => 18,
                'maxkey' => 127,
                'minkey' => 255,
            );

            $type = isset($map[$type]) ? $map[$type] : $type;
        }

        return $this->operator('$type', $type);
    }
12368
public function getHex($prefix = '')
    {
        return sprintf('%s%02x%02x%02x', $prefix, $this->r, $this->g, $this->b);
    }
757478
private static function formatVersion($version)
    {
        $version = str_replace(array('x', 'X', '*'), '0', $version);
        $exp = explode('.', $version);

        if (($size = \count($exp)) < 3) {
            for ($i = $size; $i < 3; ++$i) {
                $exp[] = '0';
            }
        }

        return $exp[0].'.'.$exp[1].'.'.$exp[2];
    }
563591
public static function getTypeDescription(?string $type): ?string
    {
        $descriptions = self::typeDescriptions();
        if (isset($descriptions[$type])) {
            return $descriptions[$type];
        }

        return $type;
    }
1113743
public function toString()
    {
        $driver = $this->getDriver();
        $prefix = $driver->getTablePrefix();
        $query  = 'DELETE';

        if($this->table && $this->join) {
            $query .= ' '.$driver->quoteIdentifier(!is_numeric(key($this->table)) ? key($this->table) : current($this->table));
        }

        if($this->table) {
            $query .= ' FROM '.$driver->quoteIdentifier($prefix.current($this->table).(!is_numeric(key($this->table)) ? ' AS '.key($this->table) : ''));
        }

        if($this->join)
        {
            $joins = array();
            foreach($this->join as $alias => $join)
            {
                $tmp = '';

                if($join['type']) {
                    $tmp .= ' '.$join['type'];
                }

                if($join['table'] instanceof DatabaseQuerySelect) {
                    $tmp .= ' JOIN ('.$join['table'].')'.(is_string($alias) ? ' AS '.$driver->quoteIdentifier($alias) : '');
                } else {
                    $tmp .= ' JOIN '.$driver->quoteIdentifier($prefix.$join['table'].(is_string($alias) ? ' AS '.$alias : ''));
                }

                if($join['condition']) {
                    $tmp .= ' ON ('.$driver->quoteIdentifier($join['condition']).')';
                }

                $joins[] = $tmp;
            }

            $query .= implode('', $joins);
        }

        if($this->where)
        {
            $query .= ' WHERE';

            foreach($this->where as $where)
            {
                if(!empty($where['combination'])) {
                    $query .= ' '.$where['combination'];
                }

                $query .= ' '.$driver->quoteIdentifier($where['condition']);
            }
        }

        if($this->order)
        {
            $query .= ' ORDER BY ';

            $list = array();
            foreach($this->order as $order) {
                $list[] = $driver->quoteIdentifier($order['column']).' '.$order['direction'];
            }

            $query .= implode(' , ', $list);
        }

        if($this->limit) {
            $query .= ' LIMIT '.$this->offset.' , '.$this->limit;
        }

        if($this->_parameters) {
            $query = $this->_replaceParams($query);
        }

        return $query;
    }
1088085
public function getNotationAspects(
        $notation,
        $field = null,
        $before = null,
        &$errors = null,
        $namespace = null
    ) {
        $params = null;
        $type = $this->getNotationType($notation, $params, $errors, $namespace);
        $aspects = $this->getNotationCommonAspects($field, $before);

        // Looking type
        switch ($type) {
            case 'schema':
                return $this->getNotationAspectsSchema($notation, $aspects);
            case 'json':
                return $this->getNotationAspectsJson($notation, $aspects);
            case 'date':
                return $this->getNotationAspectsDate($notation, $aspects);
            case 'time':
                return $this->getNotationAspectsTime($notation, $aspects);
            case 'datetime':
                return $this->getNotationAspectsDatetime($notation, $aspects);
            case 'timestamp':
                return $this->getNotationAspectsTimestamp($notation, $aspects);
            case 'primary_key':
                return $this->getNotationAspectsPrimaryKey($notation, $aspects, $params);
            case 'string':
                return $this->getNotationAspectsString($notation, $aspects);
            case 'text':
                return $this->getNotationAspectsText($notation, $aspects);
            case 'null':
                return $this->getNotationAspectsNull($notation, $aspects);
            case 'boolean':
                return $this->getNotationAspectsBoolean($notation, $aspects);
            case 'integer':
                return $this->getNotationAspectsInteger($notation, $aspects);
            case 'float':
                return $this->getNotationAspectsFloat($notation, $aspects);
            case 'double':
                return $this->getNotationAspectsDouble($notation, $aspects);
            case 'enum':
                return $this->getNotationAspectsEnum($notation, $aspects);

            case 'class':
                return static::getNotationAspectsClass($notation, $aspects, $params, $namespace);
            case 'vector':
                return static::getNotationAspectsVector($notation, $aspects, $params, $namespace);
            case 'matchs':
                return static::getNotationAspectsMatchs($notation, $aspects, $params, $namespace);
        }

        $errors[] = "irrational notation '{$notation}' by type '{$type}'";
    }
789295
public function ToDoubleString( $provider )
	{
		$sign = $this->getIsNegative();

		if ( bccomp( $this->_value, bcpow( 2, 204 ) ) > 0 )
		{
			return $sign ? -INF : INF;
		}
		else if ( bccomp( $this->getAbs()->getValue(), bcpow( 2, -149, 149 ) ) < 0 )
		{
			return $sign ? 0 : -0;
		}

		$abs = $this->getAbs();
		$decimals = rtrim( $this->getDecimalPart(), "0" );

		if ( bccomp( $abs->getValue(), 1 ) == -1 )
		{
			// Are there enough bits available to store the number?
			if ( $this->dec2bin( $decimals ) > 56 )
			{
				$exponent = 1;
				// First remove leading zeros which become part of the exponent
				while( $decimals[0] == 0 )
				{
					$exponent++;
					$decimals = substr( $decimals, 1 );
				}

				$number = $decimals[0] . "." . substr( $decimals, 1 ) . "E-" . $exponent;
			}
			else
			{
				return $this->_value;
			}
		}
		else
		{
			$digits = $this->getAbs()->getIntegerPart();

			$mantissa = rtrim( $digits . $decimals, "0" );
			$exponentRequired = strlen( $digits ) >= 20;
			while ( strlen( $this->dec2bin( $mantissa ) ) > 56 )
			{
				$mantissa = bcdiv( $mantissa, 10, 0 );
				$exponentRequired = true;
			}

			$number = $mantissa;
			if ( $exponentRequired )
			{
				$number = $mantissa[0] . "." . substr( $mantissa, 1 );
				$exponent = strlen( $digits ) -1;
				$number .= "E$exponent";
			}
			else
			{
				$number = rtrim( $digits . "." . implode( "", explode( $digits, $mantissa, 2) ), "." );
			}
		}

		if ( $sign )
		{
			$number = "-" . $number;
		}

		return $number;
	}
130481
public function toString($indent = null)
    {
        $indent = ($indent !== null)
                ? $this->getWhitespace($indent)
                : $this->getIndent();

        $return    = $this->prefix;
        $keys      = array_keys($this->container);
        $lastIndex = end($keys);
        foreach ($this->container as $index => $item) {
            $item = array_merge($this->defaultParams, (array) $item);
            $return .= vsprintf($this->wrapper, $item);
            if ($index !== $lastIndex) {
                $return .= $this->separator;
            }
        }
        $return .= $this->postfix;

        return preg_replace("/(\r\n?|\n)[ ]*/", '$1' . $indent, $return);
    }
42572
public function toString($indent = null)
    {
        $output = parent::toString($indent);
        $output = str_replace(
            ['<title>', '</title>'], ['<h1>', '</h1>'], $output
        );

        return $output;
    }
1097483
private function type2format( $type ) {
		if ( ! isset( self::$_type2format[ $type ] ) ) {
			$format = '%s';
			switch ( true ) {
				case stristr( $type, 'INT' ) !== false:
					$format = '%d';
					break;
				case stristr( $type, 'BIT' ) !== false:
					$format = '%d';
					break;
				case stristr( $type, 'BOOLEAN' ) !== false:
					$format = '%d';
					break;
				case stristr( $type, 'DECIMAL' ) !== false:
					$format = '%f';
					break;
				case stristr( $type, 'FLOAT' ) !== false:
					$format = '%f';
					break;
				case stristr( $type, 'DOUBLE' ) !== false:
					$format = '%f';
					break;
				case stristr( $type, 'REAL' ) !== false:
					$format = '%f';
					break;
			}
			self::$_type2format[ $type ] = $this->apply_filters( 'type2format', $format, $type );
		}

		return self::$_type2format[ $type ];
	}
1185999
function ToString()
    {
        $result = (string)$this->type;
        if ($this->value)
        {
            $result .= '=' . $this->value;
        }
        return $result;
    }
808768
public static function html($symbol)
    {


        if (is_string($symbol) && EmojiDictionary::get($symbol))
            $symbol = EmojiDictionary::get($symbol);

        // In case that multiple unicode sequences are used
        if (is_array($symbol))
        {
            $output = '';

            foreach ($symbol as $sequence)
                $output .= self::html($sequence);

            return $output;
        }

        $symbol = dechex($symbol);

        return '&#x' . $symbol;

    }
1107050
public function toCompliant($notation)
    {
        $chunks = explode(self::ROUTE_SYNTAX_SEPARATOR, $notation);

        // Save the action into a variable
        $action = $chunks[1];
        // Break what we have according to separators now
        $parts = explode(':', $chunks[0]);
        // Take a module and save it now
        $module = array_shift($parts);
        // It's time to build PSR-0 compliant path
        $path = sprintf('/%s/%s/%s', $module, self::ROUTE_CONTROLLER_DIR, implode('/', $parts));
        
        return array($path => $action);
    }
532167
public static function getNumberingTypeAsRtf($numbering, $prefix = '\ftnn')
    {
        switch ($numbering) {
            default:
                // const name NUMTYPE_ARABIC_NUMBERS
                return $prefix . 'ar';
            case PHPRtfLite_Footnote::NUMTYPE_ALPHABETH_LC:
                return $prefix . 'alc';
            case PHPRtfLite_Footnote::NUMTYPE_ALPHABETH_UC:
                return $prefix . 'auc';
            case PHPRtfLite_Footnote::NUMTYPE_ROMAN_LC:
                return $prefix . 'rlc';
            case PHPRtfLite_Footnote::NUMTYPE_ROMAN_UC:
                return $prefix . 'ruc';
            case PHPRtfLite_Footnote::NUMTYPE_CHICAGO;
                return $prefix . 'chi';
            case PHPRtfLite_Footnote::NUMTYPE_KOREAN_1:
                return $prefix . 'chosung';
            case PHPRtfLite_Footnote::NUMTYPE_KOREAN_2:
                return $prefix . 'ganada';
            case PHPRtfLite_Footnote::NUMTYPE_CIRCLE:
                return $prefix . 'cnum';
            case PHPRtfLite_Footnote::NUMTYPE_KANJI_1:
                return $prefix . 'dbnum';
            case PHPRtfLite_Footnote::NUMTYPE_KANJI_2:
                return $prefix . 'dbnumd';
            case PHPRtfLite_Footnote::NUMTYPE_KANJI_3:
                return $prefix . 'dbnumt';
            case PHPRtfLite_Footnote::NUMTYPE_KANJI_4:
                return $prefix . 'dbnumk';
            case PHPRtfLite_Footnote::NUMTYPE_DOUBLE_BYTE:
                return $prefix . 'dbchar';
            case PHPRtfLite_Footnote::NUMTYPE_CHINESE_1:
                return $prefix . 'gbnum';
            case PHPRtfLite_Footnote::NUMTYPE_CHINESE_2:
                return $prefix . 'gbnumd';
            case PHPRtfLite_Footnote::NUMTYPE_CHINESE_3:
                return $prefix . 'gbnuml';
            case PHPRtfLite_Footnote::NUMTYPE_CHINESE_4:
                return $prefix . 'gbnumk';
            case PHPRtfLite_Footnote::NUMTYPE_CHINESE_ZODIAC_1:
                return $prefix . 'zodiac';
            case PHPRtfLite_Footnote::NUMTYPE_CHINESE_ZODIAC_2:
                return $prefix . 'zodiacd';
            case PHPRtfLite_Footnote::NUMTYPE_CHINESE_ZODIAC_3:
                return $prefix . 'zodiacl';
        }
    }
1199422
private function convertTypeToMethod($type)
    {
        $parts = explode('.', str_replace(['-', '_'], '.', $type));
        $parts = array_map('ucfirst', $parts);

        return implode('', $parts);
    }