@param Input $input

@return array
779383
private function captureUserAndPassword(Input $input)
    {
        $text = trim(preg_replace('|\W+|', ' ', $input->text));

        return explode(' ', $text);
    }
1091376
public static function parseParameters( $input ) {
		if ( !isset( $input ) || !$input ) {
			return [];
		}

		$pairs = explode( '&', $input );

		$parsed = [];
		foreach ( $pairs as $pair ) {
			$split = explode( '=', $pair, 2 );
			$parameter = static::urldecode( $split[0] );
			$value = isset( $split[1] ) ? static::urldecode( $split[1] ) : '';

			if ( isset( $parsed[$parameter] ) ) {
				// We have already recieved parameter(s) with this name, so
				// add to the list of parameters with this name

				if ( is_scalar( $parsed[$parameter] ) ) {
					// This is the first duplicate, so transform scalar
					// (string) into an array so we can add the duplicates
					$parsed[$parameter] = [ $parsed[$parameter] ];
				}

				$parsed[$parameter][] = $value;
			} else {
				$parsed[$parameter] = $value;
			}
		}
		return $parsed;
	}
1111990
public function load($input)
    {
        return array_map(
            function (SplFileInfo $file) {
                return $file->getContents();
            },
            array_values(iterator_to_array($this->getFinder($input)))
        );
    }
377705
protected function getOptions(InputInterface $input)
    {
        $opts = array();

        foreach ($this->sshOptionOptions as $key => $option) {
            if ($input->getOption($key)) {
                $opts[$option] = $input->getOption($key);
            }
        }

        if ($input->getOption('keyfile')) {
            $opts['PasswordAuthentication'] = 'no';
            $opts['PubkeyAuthentication'] = 'yes';
            $opts['IdentitiesOnly'] = 'yes';
            $opts['IdentityFile'] = $input->getOption('keyfile');
        } else if ($input->getOption('password')) {
            $opts['PasswordAuthentication'] = 'yes';
            $opts['PubkeyAuthentication'] = 'no';
        }

        return $opts;
    }
609079
protected function generateRequestOptions( $input ) {
    $options = [
      'dataType' => 'json',
      'headers' => array_merge(self::$header, (array)$input['header']),
    ];
    $options = array_merge($options, ArrayUtils::array_pick($input, 'json', 'form', 'query'));
    return $options;
  }
611022
public function getLibraryFiles($input)
    {
        // assume the result is the same string as the input
        $result = array($input);

        // just change if method for changing/translation exists
        if (method_exists($this, 'getRequiredLibraryFiles')) {
            $result = $this->getRequiredLibraryFiles($input);
        }

        // and finally return the resulting string
        return $result;
    }
363910
public static function stripslashes(array $input): array
    {
        $result = [];
        
        foreach ($input as $k => $v) {
            $result[$k] = \is_array($v) ? self::stripslashes($v) : \stripslashes($v);
        }
        
        return $result;
    }
6639
private static function replaceKeys(array &$replacements, array $input)
    {
        $return = [];
        foreach ($input as $key => $value) {
            $key = \str_replace(\array_keys($replacements), \array_values($replacements), $key);

            if (\is_array($value)) {
                $value = self::replaceKeys($replacements, $value);
            }

            $return[$key] = $value;
        }

        return $return;
    }
741836
private function withParam( string$input )
	{
		return str_replace('$_FLAG_$',"__HTSL_CTRL_FLAG_{$this->id}__",preg_replace_callback('/(?<!%)%s((?:\\/.+?(?<!\\\\)\\/.+?(?<!\\\\)\\/)+)?/',function( array$matches ){
			$param= $this->param;

			if( isset($matches[1]) ){
				array_map(...[
					function($replacer)use(&$param){
						list($pattern,$replacement,)= preg_split('/(?<!\\\\)\\//',$replacer);
						$param= preg_replace(...[
							"/$pattern/",
							preg_replace('/^\\\\_$/','',$replacement),
							$param,
						]);
					},
					preg_split(
						'/(?<!\\\\)\\/\\//'
						,
						trim($matches[1],'/')
					),
				]);
			}
			return $param;
		},$input));
	}
636248
private function getTables(InputInterface $input)
    {
        $databaseAdapter = $this->databaseAdapterManager->getAdapter($input->getOption('adapter'));
        $tables = $databaseAdapter->getTableMetadata($input->getArgument('database'));
        $tables = $this->sort($tables, $input->getOption('sort'), $input->getOption('reverse-sort'));
        $tables = $this->format(
            $tables,
            $input->getOption('unit'),
            $input->getOption('precision')
        );
        return $tables;
    }
1096412
public static function getFlat($input, $glue = ',')
    {
        if (false === is_array($input)) {
            return $input;
        }

        $result = [];

        foreach ($input as $inputKey => $inputText) {
            if (true === is_numeric($inputKey)) {
                $result[] = self::getFlat($inputText, $glue);
            }

            $result[] = sprintf('%s: %s', $inputKey, self::getFlat($inputText, $glue));
        }

        return implode($glue, $result);
    }
407979
protected function cleanupLigatures($input)
    {
        $mapping = [
            'ﬀ' => 'ff',
            'ﬁ' => 'fi',
            'ﬂ' => 'fl',
            'ﬃ' => 'ffi',
            'ﬄ' => 'ffl',
            'ﬅ' => 'ft',
            'ﬆ' => 'st'
        ];

        return str_replace(array_keys($mapping), array_values($mapping), $input);
    }
1084680
public function update(array $input) : array {
		if (\Application::get('flag.numbers.framework.api.enforce_rest')) {
			$temp2 = $this->get($input);
			if ($temp2['values_loaded']) {
				return $this->save($input);
			} else {
				return [
					'success' => false,
					'error' => ['Can not update, record does not exists!'],
					'values' => []
				];
			}
		} else {
			return $this->save($input);
		}
	}
1058542
protected function parseTable($input)
    {
        $input = (array) $input;

        return array_map(function ($key, $value) {
            $bytes = ['used_memory', 'free_memory', 'wasted_memory', 'buffer_size'];
            $times = ['start_time', 'last_restart_time'];

            if (in_array($key, $bytes)) {
                $value = number_format($value / 1048576, 2).' MB';
            } elseif (in_array($key, $times)) {
                $value = date('Y-m-d H:i:s', $value);
            }

            return [
                'key'       => $key,
                'value'     => $value,
            ];
        }, array_keys($input), $input);
    }
1346136
protected function newSelfs(array $input)
    {
        $strObjects = [];

        foreach ($input as $key => $value)
        {
            if (is_string($value))
            {
                // Convert the scalar string to a Str Object
                $strObjects[$key] = $this->newSelf($value);
            }
            elseif (is_array($value))
            {
                // Recurse into the array
                $strObjects[$key] = $this->newSelfs($value);
            }
            else
            {
                // We don't know what it is do do nothing to it
                $strObjects[$key] = $value;
            }
        }

        return $strObjects;
    }
37880
private function getOutput($input)
	{
		$return = Api::decrypt($this->createkey() , $input);
		if (!is_array($return)) {
			ob_start();
			$return = json_decode(trim(base64_decode($input)), true);
			ob_end_clean();
		}
		if (!is_array($return)) {
			$this->error[] = 'JfusionAPI: error output: ' . $input;
			return false;
		} else if (isset($return['PHPSESSID'])) {
			$this->sid = $return['PHPSESSID'];
		}

		if (isset($return['debug'])) {
			$this->debug = $return['debug'];
		}
		if (isset($return['error']) && !empty($return['error'])) {
			return false;
		} else if (isset($return['payload'])) {
			return $return['payload'];
		}
		return true;
	}
452382
protected function flatten($input)
    {
        $list = [];

        foreach ($input as $item) {
            $list = array_merge($list, (array)$item);
        }

        return array_unique($list);
    }