return cookie parameters

@param array $args as passed to setCookieValue

@return array
430829
protected static function cookieParams($args = array())
	{
		$params = array();
		if (count($args) == 1) {
			if (is_array($args[0])) {
				$params = $args[0];
			} else {
				$params['value'] = $args[0];
			}
		} elseif (count($args) == 2) {
			if (is_string($args[1])) {
				$params['name'] = $args[1];
			} else {
				$params = $args[1];
			}
			$params['value'] = $args[0];
		}
		$domainRegex = '/([^.]+\.[a-z]{2,})(:\d{1,4})?$/i';
		$paramsDefault = array(
			// 'name'		=> 'vars',
			'value'		=> '',
			// 'lifetime'	=> null,				// can pass lifetime in lieu of expiry (ala session_set_cookie_params)
												//		lifetime param takes precedence
			'domain'	=> preg_match($domainRegex, $_SERVER['HTTP_HOST'], $matches)
						? '.'.$matches[1]
						: '',
			/*
			'expiry'	=> time()+60*60*24*30,	// 30 Days in future;  set to zero to expire when browser closes
			'path'		=> '/',
			'secure'	=> false,
			'httponly'	=> false,
			*/
		);
		$params = array_merge($paramsDefault, self::$cfgStatic, $params);
		if (isset($params['lifetime'])) {
			$params['expiry'] = time() + $params['lifetime'];
		} elseif ($params['expiry'] < time() && $params['expiry'] != 0) {
			// treat as TTL
			$params['expiry'] += time();
		}
		return $params;
	}
127626
public function get_context_param( $args = array() ) {
		$param_details = array(
			'description'        => __( 'Scope under which the request is made; determines fields present in response.' ),
			'type'               => 'string',
			'sanitize_callback'  => 'sanitize_key',
			'validate_callback'  => 'rest_validate_request_arg',
		);
		$schema = $this->get_item_schema();
		if ( empty( $schema['properties'] ) ) {
			return array_merge( $param_details, $args );
		}
		$contexts = array();
		foreach ( $schema['properties'] as $attributes ) {
			if ( ! empty( $attributes['context'] ) ) {
				$contexts = array_merge( $contexts, $attributes['context'] );
			}
		}
		if ( ! empty( $contexts ) ) {
			$param_details['enum'] = array_unique( $contexts );
			rsort( $param_details['enum'] );
		}
		return array_merge( $param_details, $args );
	}
293361
private function _format(array $args){
        $data = [];
        foreach($args as $item){
            $id = $item[$this->config['primary_key']];
            $parent_id = $item[$this->config['parent_key']];
            $data[$parent_id][$id] = (array)$item;
        }
        return $data;
    }
1314902
public function parse_query_args( $args ) {
		$query_args = [
			'frontend' => $args,
			'backend'  => $args,
		];

		if ( isset( $args['frontend'] ) || isset( $args['backend'] ) ) {
			foreach ( [ 'frontend', 'backend' ] as $query_type ) {
				$query_args[ $query_type ] = isset( $args[ $query_type ] )
					? $args[ $query_type ]
					: [];
			}
		}

		return $query_args;
	}
1196343
public function getCookieParams()
    {
        $cookies = [];
        foreach ($this->headers->getCookies() as $cookie) {
            $cookies[$cookie->getName()] = $cookie->getValue();
        };
        return $cookies;
    }
156123
public function url( array $args = []) {
		$url = get_term_link( $this->term );
		if ( $args ) {
			$url = add_query_arg( $args, $url );
		}

		return $url;
	}
713284
public function query($args = [])
    {
        $defaults = [
            'orderby'       => 'id',
            'order'         => 'DESC',
            'paginate'      => Option::get('default_posts_paginate', 20),
            'cat_in'        => [], //ids
            'cat_not_in'    => [], //ids
            'tag_in'        => [], //ids
            'tag_not_in'    => [], //ids
            'parent_in'     => [], //ids
            'parent_not_in' => [],
            'meta_query'    => [], // Array Of Arrays

        ];

        $args = array_merge($defaults, $args);

        $current_page = Request::get('page', 1);
        $cache_key = 'posts_' . md5(http_build_query($args) . '_' . $current_page);
        if (Cache::tags('posts')->has($cache_key)) {
            $posts = Cache::tags('posts')->get($cache_key);
        } else {
            $posts = $this->postRepository->queryPosts($args);

            if ( ! count($posts) > 0) {
                return new EtherError('No Posts were found');
            }

            Cache::tags('posts')->put($cache_key, $posts, \Option::get('posts_cache_expires', 60));

        }

        return $posts;
    }
328500
public function getParameters(\ReflectionFunctionAbstract $reflection, array $args = [])
    {
        $dependencies = $reflection->getParameters();
        $parameters = [];

        foreach ($dependencies as $parameter) {
            $parameters[] = $this->getParameter($parameter, $args);
        }

        return $parameters;
    }
16091
public function all(array $args = []): array
    {
        // Establish args.

        $default_args = [
            // Unique.
            'max'         => PHP_INT_MAX,
            'fail_on_max' => false,

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

        // Unique.
        $args['max']         = max(1, (int) $args['max']);
        $args['fail_on_max'] = (bool) $args['fail_on_max'];

        // Also used by {@link total()}.
        $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 (($users = &$this->cacheKey(__FUNCTION__, $cache_keys)) !== null && !$args['no_cache']) {
            return $users; // Already cached this.
        }
        // Automatically fail if there are too many; when/if desirable.

        if ($args['fail_on_max'] && $this->total($args) > $args['max']) {
            return $users = []; // Fail; too many.
        }
        // Return the array of all user objects now.

        $WP_User_Query = new \WP_User_Query(array_merge($args['filters'], [
            'fields' => 'all_with_meta', 'offset' => 0, 'paged' => 1, 'number' => -1, 'count_total' => true,
        ]));
        return $users = $WP_User_Query->get_results();
    }
179305
private function getPathMappingStates(Args $args)
    {
        $states = array(
            PathMappingState::ENABLED => 'enabled',
            PathMappingState::NOT_FOUND => 'not-found',
            PathMappingState::CONFLICT => 'conflict',
        );

        $states = array_filter($states, function ($option) use ($args) {
            return $args->isOptionSet($option);
        });

        return array_keys($states) ?: PathMappingState::all();
    }
1106518
private function getSelectedStates(Args $args)
    {
        $states = array();

        if ($args->isOptionSet('enabled')) {
            $states[] = ModuleState::ENABLED;
        }

        if ($args->isOptionSet('not-found')) {
            $states[] = ModuleState::NOT_FOUND;
        }

        if ($args->isOptionSet('not-loadable')) {
            $states[] = ModuleState::NOT_LOADABLE;
        }

        return $states ?: ModuleState::all();
    }
515806
public static function arguments(array $args) : array
    {
        putenv("CODGER_DRY=1");
        foreach ($args as $key => $value) {
            if ($value === '-w') {
                putenv("CODGER_DRY=0");
                unset($args[$key]);
            }
            if ($value === '-o') {
                putenv("CODGER_OVERWRITE=1");
                putenv("CODGER_DRY=0");
                unset($args[$key]);
            }
            if ($value === '-d') {
                putenv("CODGER_OVERWRITE=0");
                putenv("CODGER_DUMP=1");
                putenv("CODGER_DRY=0");
                unset($args[$key]);
            }
            if ($value === '-s') {
                putenv("CODGER_OVERWRITE=0");
                putenv("CODGER_SKIP=1");
                putenv("CODGER_DRY=0");
                unset($args[$key]);
            }
        }
        return array_values($args);
    }
790959
protected static function getParams(array $arg_params)
    {
        $return = array();
        //validate params
        $data = array(
            'amount',
            'transaction_id',
            'customer_id',
            'security_token',
            'customer_ip'
        );
        foreach ($data as $key) {
            if(!empty($arg_params[$key])){
                $return[$key] = $arg_params[$key];
            }
        }

        return $return;
    }
946079
private function formatArgs(array $args)
    {
        $result = array();
        foreach ($args as $key => $item) {
            if ('object' === $item[0]) {
                $formattedValue = sprintf("<em>object</em>(%s)", $this->abbrClass($item[1]));
            } elseif ('array' === $item[0]) {
                $formattedValue = sprintf("<em>array</em>(%s)", is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]);
            } elseif ('string'  === $item[0]) {
                $formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES | ENT_SUBSTITUTE, $this->charset));
            } 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", '', var_export(htmlspecialchars((string) $item[1], ENT_QUOTES | ENT_SUBSTITUTE, $this->charset), true));
            }

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

        return implode(', ', $result);
    }
1346734
protected function parseArgs($args)
    {
        if (!is_array($args)) {
            return $args;
        }

        $this->silent = in_array('--silent', $args);
        if ($this->silent) {
            $args = array_values(array_diff($args, ['--silent']));
        }

        return $args;
    }
439406
function authenticate($args)
    {
        if (!empty($_SERVER['REMOTE_USER']) && !empty($_SERVER['KRB5CCNAME'])) {
            // Load plugin's config file
            $this->load_config();

            $rcmail = rcmail::get_instance();
            $host   = $rcmail->config->get('krb_authentication_host');

            if (is_string($host) && trim($host) !== '' && empty($args['host'])) {
                $args['host'] = rcube_utils::idn_to_ascii(rcube_utils::parse_host($host));
            }

            if (!empty($_SERVER['REMOTE_USER'])) {
                $args['user'] = $_SERVER['REMOTE_USER'];
                $args['pass'] = null;
            }

            $args['cookiecheck'] = false;
            $args['valid']       = true;
        }

        return $args;
    }
1363218
protected function setArgs( $args ) {
		// Check for an API key being stored.
		if ( $this->getKey() ) {
			$args = wp_parse_args( $args, array( 'key' => $this->getKey() ) );
		}

		// Check for a site hash being stored.
		if ( $this->getSiteHash() ) {
			$args = wp_parse_args( $args, array( 'site_hash' => $this->getSiteHash() ) );
		}

		return $this->args = array(
			'timeout' => 15, // Default timeout is 5 seconds, change to 15.
			'body' => $args
		);
	}