lib/Remote/RemoteWebDriver.php
protected function prepareScriptArguments(array $arguments)
    {
        $args = [];
        foreach ($arguments as $key => $value) {
            if ($value instanceof WebDriverElement) {
                $args[$key] = ['ELEMENT' => $value->getID()];
            } else {
                if (is_array($value)) {
                    $value = $this->prepareScriptArguments($value);
                }
                $args[$key] = $value;
            }
        }

        return $args;
    }
protected function prepareScriptArguments(array $arguments)
    {
        $args = [];
        foreach ($arguments as $key => $value) {
            if ($value instanceof WebDriverElement) {
                $args[$key] = ['ELEMENT' => $value->getID()];
            } else {
                if (is_array($value)) {
                    $value = $this->prepareScriptArguments($value);
                }
                $args[$key] = $value;
            }
        }

        return $args;
    }
protected function prepareScriptArguments ( array $ arguments ) { $ args = [ ] ; foreach ( $ arguments as $ key => $ value ) { if ( $ value instanceof WebDriverElement ) { $ args [ $ key ] = [ 'ELEMENT' => $ value -> getID ( ) ] ; } else { if ( is_array ( $ value ) ) { $ value = $ this -> prepareScriptArguments ( $ value ) ; } $ args [ $ key ] = $ value ; } } return $ args ; }
Prepare arguments for JavaScript injection

@param array $arguments
@return array
Prepare arguments for JavaScript injection