@param InputInterface $input

@return array
975554
private function getFinalOptions(InputInterface $input)
    {
        $options = $input->getOptions();
        if (isset($options['config']) && $options['config'] && strtolower($options['config']) !== 'none') {
            if (!is_file($options['config'])) {
                throw new Exception('Unable to find the configuration file ' . $options['config']);
            }
            $configOptions = include $options['config'];
            if (!is_array($configOptions)) {
                throw new Exception('The configuration file did not returned an array.');
            }
            foreach ($configOptions as $k => $v) {
                if (!$input->hasParameterOption("--$k")) {
                    $options[$k] = $v;
                }
            }
        }
        if (empty($options['timezone'])) {
            $options['timezone'] = @date_default_timezone_get() ?: 'UTC';
        }
        $options['attach'] = (bool) $input->getOption('attach');
        $options['force_attach'] = (bool) $input->getOption('force-attach');
        $options['auto_attach'] = $options['attach'] || $options['force_attach'];

        return $options;
    }
1351135
protected function getConfig(InputInterface $input)
    {
        /** @var $helper ConfigurationHelper */
        $helper = $this->getHelper('config');

        return $helper->loadFile($input->getOption('configuration'));
    }
150925
public function bind(InputInterface $input)
    {
        $this->validateInput($input);

        if (!$pattern = $input->getOption('grep')) {
            $this->filter = false;

            return;
        }

        if (!$this->stringIsRegex($pattern)) {
            $pattern = '/' . \preg_quote($pattern, '/') . '/';
        }

        if ($insensitive = $input->getOption('insensitive')) {
            $pattern .= 'i';
        }

        $this->validateRegex($pattern);

        $this->filter      = true;
        $this->pattern     = $pattern;
        $this->insensitive = $insensitive;
        $this->invert      = $input->getOption('invert');
    }
307060
protected function createUser(InputInterface $input)
    {
        return $this->userFactory->createUser()
            ->setEmail($input->getArgument('email'))
            ->setPlainPassword($input->getArgument('password'));
    }
152396
protected function configureOptions(InputInterface $input)
    {
        if ($input->getOption('path')) {
            $this->finder->setPath($input->getOption('path'));
            $this->locator->setParams(array('path' => $input->getOption('path')));
        }
    }
65927
protected function parseFilterInput(array $input)
    {
        if (count($input) === 0) {
            return [];
        }

        $allowed = [];
        $model = $this->model;

        if (property_exists($model, 'filterableProperties')) {
            $allowed = $model::$filterableProperties;
        }

        $filter = [];
        foreach ($input as $key => $value) {
            if (is_numeric($key) || !preg_match('/^[A-Za-z0-9_]*$/', $key)) {
                throw new InvalidRequest("Invalid filter parameter: $key");
            }

            // check if in the list of allowed filter properties
            if (!in_array($key, $allowed)) {
                throw new InvalidRequest("Invalid filter parameter: $key");
            }

            $filter[$key] = $value;
        }

        return $filter;
    }
227191
private function generateOutput(InputInterface $input): OutputInterface
    {
        return new Output(
            $this->name,
            array_merge(
                $this->evaluateInputExports($input),
                $this->generateOutputParams($input)
            )
        );
    }
1189325
private function getResolvedPaths(InputInterface $input)
    {
        $fileName = $input->getOption('file');
        $dirPath = $input->getOption('directory');

        if ($fileName === null && $dirPath === null) {
            throw new RuntimeException('Either the --file or --directory option is required.');
        }

        if ($dirPath !== null) {
            $fileNames = [];
            $finder = new Finder();
            $finder->files()
                ->in($dirPath)
                ->name('/\.(yml|yaml|json)/')
                ->depth('<2')
                ->sortByName()
            ;
            foreach ($finder as $source) {
                $fileNames[] = $source->getFilename();
            }
            if (Path::isRelative($dirPath)) {
                $dirPath = Path::makeAbsolute($dirPath, getcwd());
            }

            return [$fileNames, $dirPath];
        }

        if (Path::isRelative($fileName)) {
            $fileName = Path::makeAbsolute($fileName, getcwd());
        }
        $dirPath = $dirPath ?: dirname($fileName);
        if (Path::isRelative($dirPath)) {
            $dirPath = Path::makeAbsolute($dirPath, getcwd());
        }

        return [(array) basename($fileName), $dirPath];
    }
218661
public function execute(InputInterface $input): OutputInterface
    {
        $this->validator->validateInput($this, $input);
        $output = $this->generateOutput($input);
        $this->validator->validateOutput($this, $output);
        return $output;
    }
135110
public function resolveFromInput(InputInterface $input): ?string
    {
        $rawOptions = $this->privatesAccessor->getPrivateProperty($input, 'options');

        $requiredOptions = [Option::IN_PACKAGES, Option::IN_CATEGORIES];

        if (count(array_intersect($requiredOptions, array_keys($rawOptions))) !== count($requiredOptions)) {
            return null;
        }

        foreach (array_keys($rawOptions) as $name) {
            if ($name === Option::IN_PACKAGES) {
                return 'packages';
            }

            return 'categories';
        }

        return null;
    }
278660
private function validate(InputInterface $input)
    {
        $validator = $this->getContainer()->get('validator');

        $fullyQualifiedClassname = $input->getArgument('fully-qualified-classname');
        $bundle = new Bundle($fullyQualifiedClassname);

        $errors = $validator->validate($bundle);
        if (count($errors) > 0) {
            $errorsString = (string) $errors;

            throw new \InvalidArgumentException($errorsString);
        }
    }
535183
public function get(array $input) : array {
		$this->form->form_object->addInput($input);
		$this->form->form_object->process();
		return $this->form->form_object->apiResult();
	}
820841
public static function findFiles(InputInterface $input)
    {
        if ($input->hasParameterOption('--config-file')) {
            $file = $input->getParameterOption('--config-file');
            if (file_exists($file)) {
                return [$file];
            }

            throw new ConfigurationFileNotFoundException(
                sprintf("Couldn't find the configuration file: %s", $file)
            );
        }

        $format = $input->hasParameterOption('--config-format')
            ? $input->getParameterOption('--config-format')
            : static::$DEFAULT_TYPE
        ;

        return [
            sprintf("%s.%s", static::$NAME, $format),
            sprintf("%s.%s.dist", static::$NAME, $format)
        ];
    }
1099802
protected function validateInput(InputInterface $input)
    {
        $options = ['tags', 'tag', 'parameters', 'parameter'];

        $optionsCount = 0;
        foreach ($options as $option) {
            if ($input->getOption($option)) {
                ++$optionsCount;
            }
        }

        $name = $input->getArgument('name');
        if ((null !== $name) && ($optionsCount > 0)) {
            throw new InvalidArgumentException('The options tags, tag, parameters & parameter can not be combined with the service name argument.');
        } elseif ((null === $name) && $optionsCount > 1) {
            throw new InvalidArgumentException('The options tags, tag, parameters & parameter can not be combined together.');
        }
    }
1339338
protected function getCommandOptions($input)
    {
        return [
            'model-name' => $this->argument('model-name'),
            '--resource-filename' => $this->option('resource-filename'),
            '--fields' => $this->option('fields'),
            '--translation-for' => $this->option('translation-for'),
            '--relations' => $this->option('relations'),
            '--indexes' => $this->option('indexes'),
        ];
    }
52924
protected function getAllProjects(InputInterface $input)
    {
        $projects = $this->api()->getProjects();
        if ($input->getOption('sort')) {
            $this->api()->sortResources($projects, $input->getOption('sort'));
        }
        if ($input->getOption('reverse')) {
            $projects = array_reverse($projects, true);
        }

        return $projects;
    }
815130
private function getResolvedPaths(InputInterface $input)
    {
        $fileName = $input->getOption('file');
        $dirPath = $input->getOption('directory');

        if ($fileName === null && $dirPath === null) {
            throw new RuntimeException('Either the --file or --directory option is required.');
        }

        $fileName = $fileName ?: rtrim($dirPath, '/') . '/' . date('YmdHis') . '.yml';
        if (Path::isRelative($fileName)) {
            $fileName = Path::makeAbsolute($fileName, getcwd());
        }

        $dirPath = $dirPath ?: dirname($fileName);
        if (Path::isRelative($dirPath)) {
            $dirPath = Path::makeAbsolute($dirPath, getcwd());
        }

        return [basename($fileName), $dirPath];
    }