Returns the path mapping states selected in the console arguments.

@param Args $args The console arguments

@return int[] The selected {@link PathMappingState} constants
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();
    }
754703
protected function ls($args) {
		$target = $args['target'];
		
		if (($volume = $this->volume($target)) == false
		|| ($list = $volume->ls($target)) === false) {
			return array('error' => $this->error(self::ERROR_OPEN, '#'.$target));
		}
		return array('list' => $list);
	}
219983
private function getCmd(array $args)
    {
        // get path to console from kernel..
        $consolePath = $this->kernel->getRootDir() . '/console';

        // this code was copied from Symfony\Component\Process\PhpProcess and deserves a cleanup
        $executableFinder = new PhpExecutableFinder();
        if (false === $php = $executableFinder->find()) {
            $php = null;
        }
        if ('\\' !== DIRECTORY_SEPARATOR && null !== $php) {
            // exec is mandatory to deal with sending a signal to the process
            // see https://github.com/symfony/symfony/issues/5030 about prepending
            // command with exec
            $php = 'exec '.$php;
        }

        $cmd = $php.' '.$consolePath.' -n ';

        foreach ($args as $key => $val) {
            if (strlen($key) > 1) {
                $cmd .= ' ' . $key;
            }
            if (strlen($key) > 1 && !is_null($val)) {
                $cmd .= '=';
            }
            if (strlen($val) > 1) {
                $cmd .= escapeshellarg($val);
            }
        }

        return $cmd;
    }
94795
private function getNormalizedArgs($method, $args): array
    {
        $normalizer = resolve(RouteNormalizer::class);
        $method = str_replace('whenYou', '', $method);
        if ($method == 'CallAction') {
            return $normalizer->normalizeAction($args);
        }
        if ($method == 'HitRouteName') {
            return $args;
        }

        $method = str_replace('VisitUrl', 'SendGet', $method);
        $method = str_replace('Send', '', $method);

        return $normalizer->normalizeUrl($args, strtoupper($method));
    }
763849
private function _resolveArgs(array $args)
        {
            $resolved = array();
            foreach ($args as $argDefinition) {
                switch ($argDefinition['type']) {
                    case 'lookup':
                        $resolved[] = $this->_lookupRecursive($argDefinition['item']);
                        break;
                    case 'value':
                        $resolved[] = $argDefinition['item'];
                        break;
                }
            }

            return $resolved;
        }
327218
public function enough_positionals( $args ) {
		$positional = $this->query_spec(
			array(
				'type'     => 'positional',
				'optional' => false,
			)
		);

		return count( $args ) >= count( $positional );
	}
773699
protected function getMappingsAndValues($operands)
    {
        $mappings = [];
        $values   = [];

        foreach ($operands as $operand) {
            if ($operand instanceof Value) {
                $values[] = $operand;
            } elseif ($operand instanceof PathInterface) {
                $mapping = $operand->getMapping();

                if ($mapping !== null) {
                    $mappings[] = $mapping;
                }
            }
        }

        return [$mappings, $values];
    }
1286666
protected function normalizeArgs($args) {
		if (is_array($args)) {
			return $args;
		}
		
		if ($args instanceof ConfigInterface) {
			return $args->toArray();
		}
		
		if ($args instanceof Traversable) {
			return iterator_to_array($args);
		}
		
		return [$args];
	}
112096
public function handleDefine(Args $args)
    {
        $flags = $args->isOptionSet('force') ? DiscoveryManager::OVERRIDE : 0;
        $bindingParams = array();
        $paramDescriptions = array();

        $this->parseParamDescriptions($args, $paramDescriptions);
        $this->parseParams($args, $bindingParams);

        $this->discoveryManager->addRootTypeDescriptor(new BindingTypeDescriptor(
            new BindingType($args->getArgument('name'), $bindingParams),
            $args->getOption('description'),
            $paramDescriptions
        ), $flags);

        return 0;
    }
788777
public function argsToParams()
    {
        $args = [];
        foreach ($this->args as $key => $value) {
            $value = is_int($key) ? $value : $key;
            preg_match("/(\\\$[\\\a-z_\\x7f-\\xff][a-z0-9_\\x7f-\\xff]*)/i", $value, $match);
            $args[] = $match[1];
        }
        return join(', ', $args);
    }
1174046
public function get(...$args)
    {
        if (count($args) === 0) {
            return $this->data;
        }

        $separator = '--'. md5(uniqid()) . '--';
        return $this->getDot(implode($separator, $args), $separator);
    }
847136
public function get_current_url( $args = [] ) {
		$url = $this->get_current_host() . $this->get_current_path();
		if ( ! empty( $args ) ) {
			$url = add_query_arg( $args, $url );
		}

		return $url;
	}
746021
private function level_and_channel_from_args( array $args ) {

		if ( ! $args ) {
			return [ '', '' ];
		}

		$level   = 0;
		$channel = '';

		if ( ! empty( $args[ 0 ] ) && is_scalar( $args[ 0 ] ) ) {
			$level = $args[ 0 ];
		}

		if ( ! empty( $args[ 1 ] ) && is_string( $args[ 1 ] ) ) {
			$channel = $args[ 1 ];
		}

		return [ $level, $channel ];
	}
139206
protected function _translateArgs($args) {
		foreach ((array)$args as $k => $arg) {
			if (is_string($arg)) {
				$args[$k] = __d($this->validationDomain, $arg);
			}
		}
		return $args;
	}
216094
private function collection($args = null) {

        static $data = [];


        if(isset($args[1])) {
            
            if(preg_match('/(.*)\[(.*)\]/', $args[0], $matches)) {

                $data[$matches[1]][$matches[2]] = $args[1];

            } else {

                $data[$args[0]] = $args[1];

                return $args[1];
            }
        }

        return $data;
    }
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;
    }
351886
protected function getEnvironmentArgument(array $args)
	{
		foreach ($args as $k => $v)
		{
			if (substr($v, 0, strlen('--env')) == '--env')
			{
				return $v;
			}
		}

		return null;
	}