Create placeholders for arguments.

@param $arguments

@return string
972780
private function createPlaceHolder($arguments)
    {
        foreach (array_keys($arguments) as $key) {
            $placeholder[] = substr(str_repeat('?,', count($key)), 0, -1);
        }

        return implode(',', $placeholder);
    }
222333
protected function _createPlaceholders($fields)
        {
            if (!empty($fields)) {
                $db_fields = [];

                foreach($fields as $key => $value) {
                    // Process expression fields directly into the query
                    if(Arrays::exists($key, $this->_expr_fields)) {
                        $db_fields[] = $value;
                    } else {
                        $db_fields[] = '?';
                    }
                }

                return implode(', ', $db_fields);
            }
        }
1360049
static function Replace($placeholder)
    {
        $args = func_get_args();    
        array_shift($args);
        return self::ReplaceArgsUsing($placeholder, null, $args);
    }
1000734
public function makeField($name, $arguments) {
        $field = new FieldMetadata($name);
        foreach($arguments as $key => $value) {
            $field->$key = $value;
        }

        return $field;
    }
261175
protected function getKeyArguments($arguments)
    {
        $keys = [];
        foreach ($arguments as $argument) {
            if (is_array($argument)) {
                $keys = array_merge($keys, $this->getKeyArguments($argument));
            }
            if (is_string($argument)) {
                $keys = array_merge($keys, $this->parseKeysString($argument));
            }
        }

        return $keys;
    }
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;
    }
644149
public function prepareCommand(array $arguments = [])
    {
        $result = '';
        foreach ($arguments as $a) {
            $result .= ' ' . escapeshellarg($a);
        }

        return $result;
    }
150812
public function setArguments($arguments)
    {
        $parameters = array_merge($this->getDefaults(), $this->arguments);

        $this->arguments = array_merge($parameters, $arguments);

        return $this;
    }
763802
public function constructorArgs($arguments)
    {
        $constructArguments = array();

        if (is_array($arguments)) {
            foreach ($arguments as $argument) {
                if (is_array($argument)) {
                    if ($argument['type'] == 'datetime') {
                        $constructArguments[] = new \DateTime($argument['value']);
                    } elseif ($argument['type'] == 'reference') {
                        $constructArguments[] = $this->loader->getReference($argument['value']);
                    } else {
                        $constructArguments[] = $argument['value'];
                    }
                } else {
                    $constructArguments[] = $argument;
                }
            }
        } else {
            $constructArguments[] = $arguments;
        }

        return $constructArguments;
    }
1051717
protected function filterPrefix(array $arguments)
    {
        if (empty($arguments)) {
            throw new InvalidArgumentException('The arguments cannot be empty');
        }

        $path = array_shift($arguments);

        if (! Assert::stringNotEmpty($path)) {
            throw new InvalidArgumentException(
                sprintf('"%s" path must be string', __METHOD__)
            );
        }

        list($prefix, $path) = $this->getPrefixAndPath($path);
        array_unshift($arguments, $path);
        unset($path);

        return [$prefix, $arguments];
    }
676474
public function addValueToArguments(array $arguments) : array
    {
        // If the caller hasn't explicitly specified where they want the value
        // to be added, we will add it as the first value. Otherwise we will
        // replace all occurrences of PIPED_VALUE with the original value.

        if (! in_array(PIPED_VALUE, $arguments, true)) {
            return array_merge([$this->value], $arguments);
        }

        return array_map(function ($argument) {
            return $argument === PIPED_VALUE ? $this->value : $argument;
        }, $arguments);
    }
559209
protected function mapArguments(array $arguments)
    {
        $keys = isset($this->mappableArguments[$this->element()]) ? $this->mappableArguments[$this->element()] : [];

        return array_combine(array_slice($keys, 0, count($arguments)), $arguments);
    }
57041
protected function createInputFromArguments(array $arguments)
    {
        return tap(new ArrayInput(array_merge($this->context(), $arguments)), function ($input) {
            if ($input->hasParameterOption(['--no-interaction'], true)) {
                $input->setInteractive(false);
            }
        });
    }
344439
private function convertArgument($argument)
    {
        if (is_string($argument) && 0 < strlen($argument) && '@' === $argument[0]) {
            $argument = new Reference(substr($argument, 1));
        }

        return $argument;
    }
508769
public function setArguments($arguments)
    {
        foreach ($arguments as $name => $argument) {
            $this->setArgument($name, $argument);
        }

        return $this;
    }
863877
public static function buildArgs($args)
    {
        if (!is_array($args)) {
            return '';
        }
        $ret = '';
        foreach ($args as $k => $v) {
            if (!is_int($v) && ($v !== null)) {
                $v = escapeshellarg($v);
            }
            if (is_int($k)) {
                $ret .= ' ' . $v;
            } else {
                if ($k{0} !== '-') {
                    $ret .= ' --' . $k . ($v !== null ? '=' . $v : '');
                } else {
                    $ret .= ' ' . $k . ($v !== null ? '=' . $v : '');
                }
            }
        }
        return $ret;
    }
666410
private function escapeArgument($argument)
    {
        if ('\\' !== DIRECTORY_SEPARATOR) {
            return "'".str_replace("'", "'\\''", $argument)."'";
        }
        if ('' === $argument = (string) $argument) {
            return '""';
        }
        if (false !== strpos($argument, "\0")) {
            $argument = str_replace("\0", '?', $argument);
        }
        if (!preg_match('/[\/()%!^"<>&|\s]/', $argument)) {
            return $argument;
        }
        $argument = preg_replace('/(\\\\+)$/', '$1$1', $argument);

        return '"'.str_replace(array('"', '^', '%', '!', "\n"), array('""', '"^^"', '"^%"', '"^!"', '!LF!'), $argument).'"';
    }