Configure the composer.json file.

@return void
348832
public function configure(Composer $composer, IOInterface $io)
    {
        $this->composer = $composer;
        $this->jsonFile = null;
        $this->io = $io;
        
        $publicDirectorySet = $this->isPublicDirectorySet();
        $wordPressInstallDirectorySet = $this->isWordPressInstallDirectorySet();
        $reposConfigured = $this->areReposConfigured();
        $sortingConfigured = $this->isSortingConfigured();
        
        if ($publicDirectorySet && $wordPressInstallDirectorySet && $reposConfigured && $sortingConfigured) {
            return;
        }
        
        if (! $publicDirectorySet) {
            $this->setPublicDirectory();
        }
        
        if (! $wordPressInstallDirectorySet) {
            $this->setWordPressInstallDirectory();
        }
        
        if (! $reposConfigured) {
            $this->configureRepos();
        }
        
        if (! $sortingConfigured) {
            $this->configureSorting();
        }
        
        $this->sortProperties();
        $this->saveJson();
    }
626445
protected function saveComposerJson($composerJson)
    {
        $newComposerJson = json_encode(
            $composerJson,
            JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES
        );

        $composerJsonPath = $this->getComposerJsonPath();
        if (File::put($composerJsonPath, $newComposerJson) === false) {
            throw new RuntimeException("Cannot write to composer.json [$composerJsonPath]");
        }
    }
480888
protected function configure(): void
    {
        $this->setAliases(['transform'])
            ->setDescription(
                'Converts the PHPDocumentor structure file to documentation'
            )
            ->setHelp(
                <<<TEXT
                This task will execute the transformation rules described in the given
                template (defaults to 'responsive') with the given source (defaults to
                output/structure.xml) and writes these to the target location (defaults to
                'output').
                
                It is possible for the user to receive additional information using the
                verbose option or stop additional information using the quiet option. Please
                take note that the quiet option also disables logging to file.
TEXT
            );

        $this->addOption(
            'source',
            's',
            InputOption::VALUE_OPTIONAL,
            'Path where the XML source file is located (optional)'
        );
        $this->addOption(
            'target',
            't',
            InputOption::VALUE_OPTIONAL,
            'Path where to store the generated output (optional)'
        );
        $this->addOption(
            'template',
            null,
            InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY,
            'Name of the template to use (optional)'
        );

        parent::configure();
    }
681466
public function composerFile(): string
    {
        if (!isset($this->cache[self::COMPOSER_FILE])) {
            $this->cache[self::COMPOSER_FILE] = $this->rootDir() . DIRECTORY_SEPARATOR . 'composer.json';
        }

        return $this->cache[self::COMPOSER_FILE];
    }
1095442
protected function configure()
    {
        if (is_readable($configFile = $this->config('config.path') . '/config.php')) {
            $config = include $configFile;
            if (!is_array($config)) {
                $config = (array) $config;
            }
            $this->config($config);
        }
        if (is_readable($configFile = $this->config('config.path') . '/config-' . $this->config('mode') . '.php')) {
            $config = include $configFile;
            if (!is_array($config)) {
                $config = (array) $config;
            }
            $this->config($config);
        }

        date_default_timezone_set($this->config('bono.timezone') ?: 'UTC');
    }
1031443
private function configure(): void
    {
        $services = array_keys($this->container->findTaggedServiceIds('app.service'));
        foreach ($services as $service) {
            $service = $this->container->get($service);
            $this->services[$service->getName()] = $service;
        }
    }
360532
protected function configure()
    {
        $this->bind(ResourceInterface::class)->to(Resource::class)->in(Scope::SINGLETON);
        $this->bind(InvokerInterface::class)->to(Invoker::class);
        $this->bind(LinkerInterface::class)->to(Linker::class);
        $this->bind(FactoryInterface::class)->to(Factory::class);
        $this->bind(SchemeCollectionInterface::class)->toProvider(SchemeCollectionProvider::class);
        $this->bind(AnchorInterface::class)->to(Anchor::class);
        $this->bind(NamedParameterInterface::class)->to(NamedParameter::class);
        $this->bind(RenderInterface::class)->to(PrettyJsonRenderer::class)->in(Scope::SINGLETON);
        $this->bind(Cache::class)->to(ArrayCache::class);
        $this->bind(RenderInterface::class)->annotatedWith('options')->to(OptionsRenderer::class);
        $this->bind(OptionsMethods::class);
        $this->bind(NamedParamMetasInterface::class)->to(NamedParamMetas::class);
    }
374198
protected function configure() {
		parent::configure();

		if (($tmp = $this->options['tmpPath'])) {
			if (!file_exists($tmp)) {
				if (@mkdir($tmp)) {
					@chmod($tmp, $this->options['tmbPathMode']);
				}
			}
			
			$this->tmpPath = is_dir($tmp) && is_writable($tmp) ? $tmp : false;
		}
		
		if (!$this->tmpPath && $this->tmbPath && $this->tmbPathWritable) {
			$this->tmpPath = $this->tmbPath;
		}

		$this->mimeDetect = 'internal';
	}
1266094
protected function configure()
    {
        $this->addArgument(
            'stage',
            InputArgument::OPTIONAL,
            'Stage or hostname'
        );
        $this->addOption(
            'parallel',
            'p',
            Option::VALUE_NONE,
            'Run tasks in parallel'
        );
        $this->addOption(
            'limit',
            'l',
            Option::VALUE_REQUIRED,
            'How many host to run in parallel?'
        );
        $this->addOption(
            'no-hooks',
            null,
            Option::VALUE_NONE,
            'Run task without after/before hooks'
        );
        $this->addOption(
            'log',
            null,
            Option::VALUE_REQUIRED,
            'Log to file'
        );
        $this->addOption(
            'roles',
            null,
            Option::VALUE_REQUIRED,
            'Roles to deploy'
        );
        $this->addOption(
            'hosts',
            null,
            Option::VALUE_REQUIRED,
            'Host to deploy, comma separated, supports ranges [:]'
        );
        $this->addOption(
            'option',
            'o',
            Option::VALUE_REQUIRED | Option::VALUE_IS_ARRAY,
            'Sets configuration option'
        );
    }
787580
protected function configure()
    {
        $this
            ->addOption('explain', '', InputOption::VALUE_NONE, 'Explains the commands that would be executed.')
            ->addOption('force', 'f', InputOption::VALUE_NONE, 'Force execution of otherwise skipped tasks.')
            ->addOption('plugin', '', InputOption::VALUE_REQUIRED, 'Load additional plugins on-the-fly')
            ->addOption('debug', '', InputOption::VALUE_NONE, "Set the debug flag")
        ;
    }
790096
private function config()
    {
        if (realpath($this->configPath) !== false) {
            $json = file_get_contents($this->configPath);
            $this->config = json_decode($json);
            $this->config->rootDir = $this->rootDir;
        } else {
            throw new \RuntimeException('Framework not initialized yet. Consider running composer install');
        }
    }
515240
private function setup()
	{
		$composer_psr4 = dirname(dirname(dirname(__DIR__))).'/composer/autoload_psr4.php';
		if (!file_exists($composer_psr4)) {
			exit("\nI can't find Composer data!");
		}

		$composer = require_once $composer_psr4;
		if (!isset($composer['Config\\'][0])) {
			exit("\nI can't find Composer data!");
		}

		//APP_CONFIGPATH defined in "index.php" or in bootstrape
    	if(!defined('_CONFIGPATH')){
      		define('_CONFIGPATH', isset($composer[''][0]) //Composer fallBack
		       ? $composer[''][0].'/Config' 
		       : dirname($vendorDir).'/Config');
    	}
    	static::$configDir = _CONFIGPATH;
    	static::$vendorDir = $vendorDir;
    	static::$baseDir = defined('_PHPPATH') ? _PHPPATH : dirname($vendorDir);
	}
200974
protected function configure()
    {
        $request = $this->getRequest();

        $adminCode = $request->get('_sonata_admin');

        if (!$adminCode) {
            throw new \RuntimeException(sprintf(
                'There is no `_sonata_admin` defined for the controller `%s` and the current route `%s`',
                \get_class($this),
                $request->get('_route')
            ));
        }

        $this->admin = $this->container->get('sonata.admin.pool')->getAdminByAdminCode($adminCode);

        if (!$this->admin) {
            throw new \RuntimeException(sprintf(
                'Unable to find the admin class related to the current controller (%s)',
                \get_class($this)
            ));
        }

        $this->templateRegistry = $this->container->get($this->admin->getCode().'.template_registry');
        if (!$this->templateRegistry instanceof TemplateRegistryInterface) {
            throw new \RuntimeException(sprintf(
                'Unable to find the template registry related to the current admin (%s)',
                $this->admin->getCode()
            ));
        }

        $rootAdmin = $this->admin;

        while ($rootAdmin->isChild()) {
            $rootAdmin->setCurrentChild(true);
            $rootAdmin = $rootAdmin->getParent();
        }

        $rootAdmin->setRequest($request);

        if ($request->get('uniqid')) {
            $this->admin->setUniqid($request->get('uniqid'));
        }
    }
274182
protected function configure(): void
    {
        // First command : Test the DB Connexion
        $this->setName($this->command)
            ->setDescription(
                'Validate a configuration for the Anonymizer'
            )->setHelp(
                'This command will validate that the configuration provided is valid' . PHP_EOL .
                "Usage: neuralyzer <info>{$this->command}</info> -f neuralyzer.yml"
            )->addOption(
                'file',
                'f',
                InputOption::VALUE_REQUIRED,
                'File',
                'neuralyzer.yml'
            )->addOption(
                'dump',
                'D',
                InputOption::VALUE_NONE,
                'Dump full configuration'
            );
    }
1298140
public function getComposerJSON()
    {
        if (!$this->composerJsonLoaded && !$this->composerJson) {
            $this->composerJsonLoaded = true;
            $this->composerJson = null;
            $jsonFile = new JsonFile(__DIR__ . '/composer.json');
            if ($jsonFile->exists()) {
                $this->composerJson = $jsonFile->read();
            }
        }

        return $this->composerJson;
    }
228388
protected function configure()
    {
        $this->setDescription($this->shortDesc);

        foreach($this->paramsArray as $nameParam => $arrayOptions){
            if($arrayOptions['optional']){
                $this->addOption($nameParam, null, InputOption::VALUE_OPTIONAL, $arrayOptions['comment'], null);
            }
            else {
                $this->addOption($nameParam, null, InputOption::VALUE_REQUIRED, $arrayOptions['comment'], null);
            } 
        }
    }
52869
public function install()
    {
        $grumPhpFile = $this->destination . '/grumphp.yml';

        if (file_exists($grumPhpFile)) {
            unlink($grumPhpFile);
            $this->io->write(
                sprintf(
                    '<comment>Removed:</comment> existing GrumPHP config file %s',
                    $grumPhpFile
                )
            );
        }

        $definition = $this->file->read();
        if (!empty($definition['extra']['grumphp']['config-default-path'])) {
            return;
        }

        $definition['extra']['grumphp']['config-default-path'] =
            'vendor/mediact/testing-suite/config/default/grumphp.yml';

        $this->file->write($definition);
        $this->io->write(
            '<info>Added:</info> GrumPHP config to composer.json'
        );
    }