Retrieve the prefix from an arguments array.

@param array $arguments

@return array [:prefix, :arguments]
544650
public function filterPrefix(array $arguments)
    {
        if (empty($arguments)) {
            throw new \InvalidArgumentException('At least one argument needed');
        }

        $path = &$arguments[0];

        if (!\is_string($path)) {
            throw new \InvalidArgumentException('First argument should be a string');
        }

        [$prefix, $path] = $this->getPrefixAndPath($path);

        return [$prefix, $arguments];
    }
859983
protected function processArguments($arguments)
    {
        if (false === is_array($arguments)) {
            return $arguments;
        }

        return array_map(function ($argument) {
            return (string) $argument;
        }, $arguments);
    }
1119774
protected static function parseArguments(array $arguments) {
    $string = '';
    foreach ($arguments as $name => $value) {
      if (is_null($value)) {
        $string .= ' --' . $name;
      }
      else {
        $string .= ' --' . $name . '=' . $value;
      }
    }
    return $string;
  }
576965
protected function _processArguments( $arguments )
    {
        //	Process command line arguments
        $_className = array_shift( $arguments );
        $_options = $this->getArguments( $arguments );
        $arguments = array_merge( array($_className), $_options['rebuilt'] );

        //	Set our values based on options...
        $this->set( $_options );

        return $arguments;
    }
563940
protected function getSize( $arguments ) {
		$size = 'full';

		if ( ! empty( $arguments['width'] ) && ! empty( $arguments['height'] ) ) {
			$size = [ intval( $arguments['width'] ), intval( $arguments['height'] ) ];
		} elseif ( ! empty( $arguments['size'] ) ) {
			$size = [ intval( $arguments['size'] ), intval( $arguments['size'] ) ];
		}

		return $size;
	}
694289
public function getArguments( $arguments = array() )
    {
        $_results = array(
            'original' => $arguments,
            'rebuilt'  => array(),
            'options'  => array(),
        );

        //	Our return options array...
        $_options = array();

        //	Rebuild args...
        for ( $_i = 0, $_count = count( $arguments ); $_i < $_count; $_i++ )
        {
            $_argument = $arguments[$_i];
            $_value = trim( substr( $_argument, 0, strpos( $_argument, '=' ) ) );

            if ( $_value && $_value[0] == '-' && $_value[1] == '-' )
            {
                $_options[substr( $_value, 2 )] = str_replace( $_value . '=', '', $_argument );
            }
            elseif ( $_value && $_value[0] == '-' )
            {
                $_options[substr( $_value, 1 )] = str_replace( $_value . '=', '', $_argument );
            }
            else
            {
                $_results['rebuilt'][] = $arguments[$_i];
            }
        }

        $_results['options'] = $_options;

        //	Return the processed results...
        return $_results;
    }
19324
private function formatArguments($arguments)
    {
        $result = [];
        foreach ($arguments as $key => $argument) {
            if (is_object($argument)) {
                $result[$key] = get_class($argument);
                continue;
            }

            if (is_array($argument)) {
                $result[$key] = $this->formatArguments($argument);
                continue;
            }

            $result[$key] = $argument;
        }

        return $result;
    }
525619
private static function parseParams(array $arguments): string
    {
        if (0 === count($arguments)) {
            return '';
        }

        $arguments = array_map(function ($argument) {
            return beautify_parse('<argument:argument>', [
                'argument' => sprintf('"%s"', $argument),
            ]);
        }, $arguments);

        $parameters = implode(', ', $arguments);

        return sprintf('(%s)', $parameters);
    }
1266038
protected static function getHighlightInfo($arguments)
    {
        $highlightInfo = [];
        $documentID = $arguments['document'][$arguments['idKey']];
        if ($documentID) {
            $highlighting = $arguments['results']->getHighlighting();

            if ($highlighting) {
                if ($arguments['alternateField']) {
                    $highlightInfo += $highlighting->getResult($documentID)->getField($arguments['alternateField']);
                } else {
                    $highlightInfo += $highlighting->getResult($documentID)->getField($arguments['field']);
                }
            }
        }

        return $highlightInfo;
    }
10929
public function get($name, array $arguments = null)
    {
        $this->load();
        if ($arguments === null) {
            $arguments = [$this->env];
        }
        if (isset($this->config[$name])) {
            $entry = $this->config[$name];
            if (is_callable($entry)) {
                return $entry(...$arguments);
            } elseif (is_object($entry)) {
                return $entry;
            } else {
                $name = $entry;
            }
        }
        return new $name(...$arguments);
    }
1207300
public function query(array $arguments = [])
    {
        $defaults = array_merge($this->queryDefaults, [
            'post_type' => $this->getSlug(),
        ]);

        return $this->plugger
            ->setModel($this)
            ->setAdapter(Post::class)
            ->plugIn(get_posts(array_merge($arguments, $defaults)))
            ->getConnected();
    }
785273
public function invokeArguments(array $arguments)
    {
        $parsedArguments = $this->argumentParser->parse($arguments, $this->getParameters());

        return call_user_func_array($this->callable, $parsedArguments);
    }
199504
public function query(array $arguments = [])
    {
        $adaptees = get_terms(['taxonomy' => $this->getSlug()]);

        return $this->plugger
            ->setModel($this)
            ->setAdapter(Term::class)
            ->plugIn($adaptees)
            ->getConnected();
    }
1123316
protected function normalizeInput($arguments)
    {
        if (is_array($arguments[0])) {
            return $arguments[0];
        }

        if (count($arguments) == 2) {
            return [$arguments[0] => $arguments[1]];
        }

        throw new Exception('Try JavaScript::put(["foo" => "bar"])');
    }
936467
public static function constructStringFromArguments(array $arguments): string
    {
        $result = '';
        foreach ($arguments as $argument) {
            $result .= ' ' . $argument;
        }

        return $result;
    }
1071653
protected static function getModuleSignatureFromArguments(array $arguments)
    {
        $moduleSignature = $arguments['signature'];

        $possibleErrorMessageAppendix = self::ERROR_APPENDIX_FOR_WRONG_SIGNATURE_ARGUMENT;
        $possibleErrorCode = 1496311009;
        if (!is_string($moduleSignature)) {
            $moduleSignature = $arguments['main'];
            $subModuleName = $arguments['extension'] . GeneralUtility::underscoredToUpperCamelCase($arguments['sub']);
            $moduleSignature .= '_' . $subModuleName;
            $possibleErrorMessageAppendix = vsprintf(self::ERROR_APPENDIX_FOR_SIGNATURE_RESOLUTION, [$arguments['extension'], $arguments['main'], $arguments['sub']]);
            $possibleErrorCode = 1496311010;
        }
        if (!isset($GLOBALS['TBE_MODULES']['_configuration'][$moduleSignature])) {
            throw new \RuntimeException(vsprintf('Module with signature "%s" is not configured or couldn\'t be resolved. ' . $possibleErrorMessageAppendix, [$moduleSignature]), $possibleErrorCode);
        }
        return $moduleSignature;
    }
41140
public function prefixValues(array $arguments, $prefix)
    {
        $skip = ['id', 'ID'];

        return array_map(function ($key) use ($prefix, $skip) {
            if (in_array($key, $skip)) {
                return $key;
            }

            return "{$prefix}{$key}";
        }, $arguments);
    }