Convert UCS-4 strin into UCS-4 garray

@param  string $input

@return array
779246
protected function _ucs4_string_to_ucs4($input)
    {
        $output  = [];
        $inp_len = self::byteLength($input);
        // Input length must be dividable by 4
        if ($inp_len % 4) {
            $this->_error('Input UCS4 string is broken');

            return false;
        }
        // Empty input - return empty output
        if (!$inp_len) {
            return $output;
        }
        for ($i = 0, $out_len = -1; $i < $inp_len; ++$i) {
            // Increment output position every 4 input bytes
            if (!($i % 4)) {
                $out_len++;
                $output[$out_len] = 0;
            }
            $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4)));
        }

        return $output;
    }
1096960
public function removeEmptyInput($input)
    {
        $filterableInput = [];

        foreach ($input as $key => $val) {
            if ($val !== '' && $val !== null) {
                $filterableInput[$key] = $val;
            }
        }

        return $filterableInput;
    }
174815
protected function replaceSpecialChars($input)
	{
		if(is_array($input))
		{
			$result = [];
			
			foreach($input as $k => $v)
			{
				$result[$k] = $this->replaceSpecialChars($v);
			}
			
			return $result;
		}
		
		return strtr($input, [
			'\n' => "\n",
			'\t' => "\t"
		]);
	}
538165
protected function _decodePart($input)
    {
        $n = static::INITIAL_N;
        $i = 0;
        $bias = static::INITIAL_BIAS;
        $output = '';

        $pos = strrpos($input, static::DELIMITER);
        if ($pos !== false) {
            $output = substr($input, 0, $pos++);
        } else {
            $pos = 0;
        }

        $outputLength = strlen($output);
        $inputLength = strlen($input);

        /* Punycode lookup is case-insensitive. */
        $input = Horde_String::lower($input);

        while ($pos < $inputLength) {
            $oldi = $i;
            $w = 1;

            for ($k = static::BASE; ; $k += static::BASE) {
                $digit = static::$_decodeTable[$input[$pos++]];
                $i = $i + ($digit * $w);
                $t = $this->_calculateThreshold($k, $bias);

                if ($digit < $t) {
                    break;
                }

                $w = $w * (static::BASE - $t);
            }

            $bias = $this->_adapt($i - $oldi, ++$outputLength, ($oldi === 0));
            $n = $n + (int) ($i / $outputLength);
            $i = $i % ($outputLength);

            $output = Horde_String::substr($output, 0, $i, 'UTF-8') .
                $this->_codePointToChar($n) .
                Horde_String::substr($output, $i, $outputLength - 1, 'UTF-8');

            ++$i;
        }

        return $output;
    }
1036393
public static function toStudlyCase($input) {
		$input = trim($input, '-_');
		return ucfirst(preg_replace_callback('/([A-Z-_][a-z]+)/', function($matches) {
			return ucfirst(str_replace(['-','_'], '',$matches[0]));
		}, $input));
	}
310510
private function hangulCompose(array $input): array
    {
        $inputLength = count($input);
        if ($inputLength === 0) {
            return [];
        }

        $previousCharCode = (int) $input[0];

        // copy first codepoint from input to output
        $result = [
            $previousCharCode,
        ];

        for ($i = 1; $i < $inputLength; ++$i) {
            $charCode = (int) $input[$i];
            $sIndex = $previousCharCode - self::sBase;
            $lIndex = $previousCharCode - self::lBase;
            $vIndex = $charCode - self::vBase;
            $tIndex = $charCode - self::tBase;

            // Find out, whether two current characters are LV and T
            if (0 <= $sIndex
                && $sIndex < self::sCount
                && ($sIndex % self::tCount == 0)
                && 0 <= $tIndex
                && $tIndex <= self::tCount
            ) {
                // create syllable of form LVT
                $previousCharCode += $tIndex;
                $result[(count($result) - 1)] = $previousCharCode; // reset last

                continue; // discard char
            }

            // Find out, whether two current characters form L and V
            if (0 <= $lIndex
                && $lIndex < self::lCount
                && 0 <= $vIndex
                && $vIndex < self::vCount
            ) {
                // create syllable of form LV
                $previousCharCode = (int) self::sBase + ($lIndex * self::vCount + $vIndex) * self::tCount;
                $result[(count($result) - 1)] = $previousCharCode; // reset last

                continue; // discard char
            }
            // if neither case was true, just add the character
            $previousCharCode = $charCode;
            $result[] = $charCode;
        }

        return $result;
    }
1284450
protected function cleanInputData(array $input)
    {
        $columns = $this->getColumns();
        foreach ($columns as $column) {
            if (!isset($input[$column])) {
                $input[$column] = '';
            }
        }
        return $input;
    }
1040556
public function convert( $input ) {

        $result = new SearchResult(
            array(
                'time'       => 0,
                'maxScore'   => 0,
                'totalCount' => $input['SearchCount'],
            )
        );

        $contentService = $this->repository->getContentService();

        foreach ( $input['SearchResult'] as $doc )
        {
            $contentObject = $contentService->loadContent( $doc->ContentObjectID );
            $searchHit = new SearchAndFilterHit(
                array(
                    'score'         => 0,
                    'valueObject'   => $contentObject,
                    'objectStates'  => $this->loadContentObjectStates( $contentObject->contentInfo )
                )
            );
            $result->searchHits[] = $searchHit;
        }
        return $result;
    }
1317404
public static function convert($input = STDIN)
    {
        $stream = fopen('php://temp', 'rw');

        foreach ($_SERVER as $key => $value) {
            if (0 === strpos($key, 'HTTP_')) {
                $key = str_replace('_', '-', strtolower(substr($key, 5)));
                fwrite($stream, "$key: $value\r\n");
            } elseif (in_array($key, ['CONTENT_LENGTH', 'CONTENT_MD5', 'CONTENT_TYPE'])) {
                $key = str_replace('_', '-', strtolower($key));
                fwrite($stream, "$key: $value\r\n");
            }
        }

        fwrite($stream, "\r\n");

        stream_copy_to_stream($input, $stream);

        rewind($stream);

        return new StreamedPart($stream);
    }
957189
private function parseValue($input)
    {
        if (is_array($input)) {

        } elseif (substr($input, 0, 1) === '"' && substr($input, -1) === '"') {
            $input = substr($input, 1, -1);
        } elseif (strpos($input, "|") !== false) {
            $input = explode("|", $input);
            foreach ($input as $key => $value) {
                $input[$key] = $this->parseValue($value);
            }
        } elseif ($input === "false") {
            $input = false;
        } elseif ($input === "true") {
            $input = true;
        } elseif (is_numeric($input)) {
            if (strpos($input, ".") !== false) {
                $input = (float)$input;
            } else {
                $input = (int)$input;
            }
        } elseif ($input === "on") {
            $input = true;
        }

        return $input;
    }
282239
private function arrayAnalyzer($input)
    {
        $result = [];
        foreach ($input as $key => $value) {
            if ($key == 'Field') {
                $result[] = $value;
            } elseif ($key == 'Type') {
                if (str_contains($value, 'int')) {
                    $result[] = 'text';
                } elseif (str_contains($value, 'char')) {
                    $result[] = 'text';
                } elseif ($value = 'date') {
                    $result[] = 'date';
                }
            }
        }

        return $result;
    }
1125145
public static function parseLines($input): array
    {
        if (is_array($input)) {
            $input = implode(PHP_EOL, $input);
        }

        return Str::parseLines($input);
    }
103626
protected function normalize(array $input) : array
    {
        $normalized = [];
        foreach ($this->rules() as $field => $value) {
            $normalized[$field] = $input[$field] ?? '';
        }
        return $normalized;
    }
843444
private function fromFlattenedSerializationRecipientToSerialization($input)
    {
        $recipient = [];
        foreach (['header', 'encrypted_key'] as $key) {
            if (array_key_exists($key, $input)) {
                $recipient[$key] = $input[$key];
            }
        }
        $recipients = [
            'ciphertext' => $input['ciphertext'],
            'recipients' => [$recipient],
        ];
        foreach (['protected', 'unprotected', 'iv', 'aad', 'tag'] as $key) {
            if (array_key_exists($key, $input)) {
                $recipients[$key] = $input[$key];
            }
        }

        $this->log(LogLevel::INFO, 'JWE in Flattened JSON Serialization mode loaded.');

        return $recipients;
    }
188764
protected function parseCsv($input)
    {
        $temp = fopen('php://memory', 'rw');
        fwrite($temp, $input);
        fseek($temp, 0);
        $res = array();
        while (($data = fgetcsv($temp)) !== false) {
            $res[] = $data;
        }
        fclose($temp);

        return $res;
    }
404173
public static function studly($input)
    {
        $input = mb_convert_case($input, \MB_CASE_TITLE, 'UTF-8');
        $input = str_replace(array('-', '_'), ' ', $input);
        $input = str_replace(' ', '', $input);

        return $input;
    }
757313
public function parse($input)
    {
        if (is_null($input) || empty($input)) {
            return $input;
        }
        $character = $this->getOption('character');
        $regex = strtr($this->getOption('regex'), $this->getOption('regex_replacement'));

        preg_match_all($regex, $input, $matches);

        $matches = array_map([$this, 'mapper'], $matches[0]);

        $matches = $this->removeNullKeys($matches);
        $matches = $this->prepareArray($matches);

        $output = preg_replace_callback($matches, [$this, 'replace'], $input);

        return $output;
    }