Workaround IE7's content counter bug.

@param array $args

@return array
967866
protected function libCounter($args)
    {
        $list = array_map([$this, 'compileValue'], $args);

        return [Type::T_STRING, '', ['counter(' . implode(',', $list) . ')']];
    }
245178
protected function pagination( $args = array() ) {

		// Parse args
		$r = wp_parse_args( $args, array(
			'small'  => '1 day',
			'large'  => '1 week',
			'labels' => array(
				'next_small' => esc_html__( 'Tomorrow',      'wp-event-calendar' ),
				'next_large' => esc_html__( 'Next Week',     'wp-event-calendar' ),
				'prev_small' => esc_html__( 'Yerterday',     'wp-event-calendar' ),
				'prev_large' => esc_html__( 'Previous Week', 'wp-event-calendar' )
			)
		) );

		// Return pagination
		return parent::pagination( $r );
	}
212275
protected function normalizeMailArgs(array $args): array
    {
        // If the first argument is an array, use it as the mail configuration
        if (is_array($args[0])) {
            return $args[0];
        }
        $result = [];
        $length = count($args);
        // FIXME This is a weak way to handle the arguments, since a change in the order will break it
        for ($i = 0; $i < $length; $i++) {
            $result[$this->argumentsMapping[$i]] = $args[$i];
        }
        return $result;
    }
423239
public function total(array $args = []): int
    {
        // Establish args.

        $default_args = [
            // Also used by {@link all()}.
            'filters'  => [],
            'no_cache' => false,
        ];
        $args = array_merge($default_args, $args);
        $args = array_intersect_key($args, $default_args);

        $args['filters']  = (array) $args['filters'];
        $args['no_cache'] = (bool) $args['no_cache'];

        // Check cache; already did this query?

        $cache_keys = $args; // Keys to consider when checking the cache.
        unset($cache_keys['no_cache']); // Cache key exclusions.

        if (($total = &$this->cacheKey(__FUNCTION__, $cache_keys)) !== null && !$args['no_cache']) {
            return $total; // Already cached this.
        }
        // Establish total users in the query.

        $WP_User_Query = new \WP_User_Query(array_merge($args['filters'], [
            'fields' => 'ID', 'offset' => 0, 'paged' => 1, 'number' => 1, 'count_total' => true,
        ]));
        return $total = (int) $WP_User_Query->get_total();
    }
621860
protected function adjustPageArgumentToPositiveInteger(array $arguments)
    {
        $page = isset($arguments['page']) ? intval($arguments['page']) : 0;
        $arguments['page'] = max($page, 0);

        return $arguments;
    }
107996
private function preserveOldArgFormat(array $args)
    {
        if (isset($args[0]) && !is_array($args[0])) {
            $args = [$args];
        } elseif (empty($args)) {
            $args = [[]];
        }

        return $args;
    }
1199219
public static function prepareCommand(array $args)
    {
        $return = '*' . \count($args) . "\r\n";
        foreach ($args as $arg) {
            $return .= '$' . \strlen($arg) . "\r\n" . $arg . "\r\n";
        }

        return $return;
    }
1296559
private function cmdMount($args)
    {
        $cmd = new MountCommand($this->cwd);

        return $cmd->run(array_slice($args, 1));
    }
559742
public function listDebuggees(array $args = [])
    {
        return $this->send([$this->debuggerClient, 'listDebuggees'], [
            $this->pluck('project', $args),
            DebuggerClient::getDefaultAgentVersion(),
            $args
        ]);
    }
466019
private function flattenArgs($args, $level = 0, &$count = 0)
    {
        $result = [];
        foreach ($args as $key => $value) {
            if (++$count > 10000) {
                return ['array', '*SKIPPED over 10000 entries*'];
            }
            if ($value instanceof \__PHP_Incomplete_Class) {
                // is_object() returns false on PHP<=7.1
                $result[$key] = ['incomplete-object', $this->getClassNameFromIncomplete($value)];
            } elseif (is_object($value)) {
                $result[$key] = ['object', get_class($value)];
            } elseif (is_array($value)) {
                if ($level > 10) {
                    $result[$key] = ['array', '*DEEP NESTED ARRAY*'];
                } else {
                    $result[$key] = ['array', $this->flattenArgs($value, $level + 1, $count)];
                }
            } elseif (null === $value) {
                $result[$key] = ['null', null];
            } elseif (is_bool($value)) {
                $result[$key] = ['boolean', $value];
            } elseif (is_int($value)) {
                $result[$key] = ['integer', $value];
            } elseif (is_float($value)) {
                $result[$key] = ['float', $value];
            } elseif (is_resource($value)) {
                $result[$key] = ['resource', get_resource_type($value)];
            } else {
                $result[$key] = ['string', (string)$value];
            }
        }

        return $result;
    }
626178
protected function tmb($args) {
		
		$result  = array('images' => array());
		$targets = $args['targets'];
		
		foreach ($targets as $target) {
			if (($volume = $this->volume($target)) != false
			&& (($tmb = $volume->tmb($target)) != false)) {
				$result['images'][$target] = $tmb;
			}
		}
		return $result;
	}
307440
protected function size($args) {
		$size = 0;
		
		foreach ($args['targets'] as $target) {
			if (($volume = $this->volume($target)) == false
			|| ($file = $volume->file($target)) == false
			|| !$file['read']) {
				return array('error' => $this->error(self::ERROR_OPEN, '#'.$target));
			}
			
			$size += $volume->size($target);
		}
		return array('size' => $size);
	}
494034
protected function encodeContent(array $args) {
        $data = [];
        foreach ($args as $key => $item) {
            $data[] = sprintf('"%s"="%s"', $key, $item);
        }
        return '{'.implode(',', $data).'}';
    }
487650
public function formatArgs($args)
    {
        $result = [];
        foreach ($args as $key => $item) {
            if ('object' === $item[0]) {
                $parts = explode('\\', $item[1]);
                $short = array_pop($parts);
                $formattedValue = sprintf('<em>object</em>(<abbr title="%s">%s</abbr>)', $item[1], $short);
            } elseif ('array' === $item[0]) {
                $formattedValue = sprintf('<em>array</em>(%s)', \is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]);
            } elseif ('null' === $item[0]) {
                $formattedValue = '<em>null</em>';
            } elseif ('boolean' === $item[0]) {
                $formattedValue = '<em>'.strtolower(var_export($item[1], true)).'</em>';
            } elseif ('resource' === $item[0]) {
                $formattedValue = '<em>resource</em>';
            } else {
                $formattedValue = str_replace("\n", '', htmlspecialchars(var_export($item[1], true), ENT_COMPAT | ENT_SUBSTITUTE, $this->charset));
            }

            $result[] = \is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue);
        }

        return implode(', ', $result);
    }
698245
protected function getSafeArguments(array $args)
    {
        $argsSafe = [];
        foreach ($args as $arg) {
            $type = gettype($arg);
            switch ($type) {
                case 'string':
                    $argsSafe[] = sprintf('<span>"%s"</span>', Html::trimText($arg, 30));
                    break;

                case 'integer':
                case 'float':
                    $argsSafe[] = sprintf('<span>%s</span>', $arg);
                    break;

                case 'object':
                    $className = get_class($arg);
                    $shortName = (new \ReflectionClass($arg))->getShortName();
                    $argsSafe[] = sprintf('<abbr title="%s">%s</abbr>', $className, $shortName);
                    break;

                case 'boolean':
                    $argsSafe[] = $arg ? '[true]' : '[false]';
                    break;

                default:
                    $argsSafe[] = '[' . $type . ']';
            }
        }

        return $argsSafe;
    }
258008
protected function parseArguments(array $args)
    {
        $output = [];

        foreach ($args as $arg) {
            if (is_string($arg) && strpos($arg, '@') === 0) {
                $service = substr($arg, 1);
                $output[] = $this->container->get($service);

                continue;
            }

            $output[] = $arg;
        }

        return $output;
    }
722812
protected function parseArguments(array $args)
    {
        if (count($args) === 1 && is_array($args[0])) {
            $args = $args[0];
        }

        if (count($args) === 0) {
            throw new QueryException('No arguments given');
        }

        return $args;
    }