protected function createConfiguration(array $options, $rootDir, InputInterface $input = null)
    {
        $configuration = new Configuration();
        $file = new Path();

        $repoToken = $options['repo_token'];
        $repoSecretToken = $options['repo_secret_token'];

        // handle coverage clover
        $coverage_clover = $options['coverage_clover'];
        if ($input !== null && $input->hasOption('coverage_clover')) {
            $option = $input->getOption('coverage_clover');
            if (!empty($option)) {
                $coverage_clover = $option;
            }
        }

        // handle output json path
        $json_path = $options['json_path'];
        if ($input !== null && $input->hasOption('json_path')) {
            $option = $input->getOption('json_path');
            if (!empty($option)) {
                $json_path = $option;
            }
        }

        return $configuration
            ->setRepoToken($repoToken !== null ? $repoToken : $repoSecretToken)
            ->setServiceName($options['service_name'])
            ->setRootDir($rootDir)
            ->setCloverXmlPaths($this->ensureCloverXmlPaths($coverage_clover, $rootDir, $file))
            ->setJsonPath($this->ensureJsonPath($json_path, $rootDir, $file))
            ->setExcludeNoStatements($options['exclude_no_stmt']);
    }