Return the Composer instance.

@return \Eyewitness\Eye\Monitors\Composer
492706
public function composer()
    {
        if (is_null($this->composer)) {
            $this->composer = app(Composer::class);
        }

        return $this->composer;
    }
763300
public function build()
    {
        $packages = [];

        if ($this->files->exists($path = $this->vendorPath.'/composer/installed.json')) {
            $packages = json_decode($this->files->get($path), true);
        }

        $ignoreAll = in_array('*', $ignore = $this->packagesToIgnore());

        $this->write($keys = collect($packages)->mapWithKeys(function ($package) {
            return [$this->format($package['name']) => $package['extra']['nano7'] ? $package['extra']['nano7'] : []];
        })->each(function ($configuration) use (&$ignore) {
            $ignore = array_merge($ignore, $configuration['dont-discover'] ? $configuration['dont-discover'] : []);
        })->reject(function ($configuration, $package) use ($ignore, $ignoreAll) {
            return $ignoreAll || in_array($package, $ignore);
        })->filter()->all());

        return $keys;
    }
1041784
public function getComposer(IOInterface $inputOutput = null)
    {
        if (null === $inputOutput) {
            $inputOutput = $this->getInputOutput();
        }
        RuntimeHelper::setupHome($this->getTensideHome());

        return ComposerFactory::create($inputOutput);
    }
411762
protected function getPatcher()
    {
        if ($this->patcher === null) {
            $this->patcher = new Patcher($this->io, $this->composer->getInstallationManager(), $this->composer->getEventDispatcher(), new ProcessExecutor($this->io), $this->getVolatileDirectory());
        }

        return $this->patcher;
    }
471517
private static function _resetComposer()
	{
		self::$composer = null;
		self::$factory = null;
		self::$repositoryManager = null;
		self::$localRepository = null;
		self::$remoteRepositories = null;
		self::$io = null;
		self::$installer = null;
		self::$dispatcher = null;
		return self::_init();
	}
250315
public function create($fromSource = false)
    {
        $packageRepository = $this->composerRuntime->getRepositoryManager()->getLocalRepository();
        
        $pluginPackage = $this->packageResolver->resolveForNamespace($packageRepository, __NAMESPACE__);
        
        $packageInfoResolver = new \Vaimo\ComposerChangelogs\Resolvers\PackageInfoResolver(
            $this->composerRuntime->getInstallationManager()
        );

        $infoExtractor = $this->createInfoExtractor($packageInfoResolver, $fromSource);

        $pluginConfig = new \Vaimo\ComposerChangelogs\Composer\Plugin\Config();
        
        return new \Vaimo\ComposerChangelogs\Resolvers\ChangelogConfigResolver(
            $pluginPackage,
            $pluginConfig,
            $packageInfoResolver,
            $infoExtractor
        );
    }
1074937
public function getComposer(bool $required = true, $config = null): Composer
    {
        if (null === $this->composer) {
            try {
                $this->composer = Factory::create($this->io, $config);
            } catch (\InvalidArgumentException $e) {
                $this->io->write($e->getMessage());
                exit(1);
            }
        }

        return $this->composer;
    }
137141
public function getComposerVersion() {
    $version = $this->executor->execute("composer --version")
      ->interactive(FALSE)
      ->silent(TRUE)
      ->run()
      ->getMessage();

    return $version;
  }
670372
public function composerInstall() {
    $result = $this->taskExec(
      (DIRECTORY_SEPARATOR == "\\") ? 'set' : 'export' .
        " COMPOSER_EXIT_ON_PATCH_FAILURE=1 && composer install --ansi --no-interaction --optimize-autoloader --apcu-autoloader"
    )
      ->dir($this->getConfigValue('repo.root'))
      ->interactive($this->input()->isInteractive())
      ->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE)
      ->run();

    return $result;
  }
805249
private function initializeRepos()
    {
        $composer = $this->getComposer(false);

        if ($composer) {
            return array(
                $composer->getRepositoryManager()->getLocalRepository(),
                new CompositeRepository($composer->getRepositoryManager()->getRepositories())
            );
        }

        $defaultRepos = Factory::createDefaultRepositories($this->getIO());

        return array(new CompositeRepository($defaultRepos));
    }
14837
public static function getComposerMap() {
        $composerMap = array();
        foreach (self::getComposers() as $composer)
            $composerMap[call_user_func(array($composer, "getKind"))] = $composer;
        return $composerMap;
    }
861220
private static function getInstalledComposerJson()
    {
        $finder = new Finder();
        $finder->files()
            ->name('composer.json')
            ->notPath('vendor/composer')
            ->depth(2)
            ->followLinks()
        ;
        try {
            $finder->in(['vendor']);
        } catch (\InvalidArgumentException $e) {
            // Composer has not had its autoloader dumped
        }

        return $finder;
    }
1016333
protected function getComposerCommand()
    {
        static $command = null;

        if (null !== $command) {
            return $command;
        }

        // Detect local composer.phar.
        $pharFile = $this->projectPath . '/composer.phar';

        if (file_exists($pharFile)) {
            return $command = '/usr/bin/env php -d allow_url_fopen=On -d detect_unicode=Off "' . $pharFile . '"';
        }

        // Detect local composer command
        $composerFile = $this->projectPath . '/composer';

        if (file_exists($composerFile)) {
            return $command = './composer';
        }

        // Detect global composer command.
        $process = new Process('hash composer');
        $process->run();
        $isSuccessful = $process->isSuccessful();

        unset($process);

        if ($isSuccessful) {
            return $command = 'composer';
        }

        return $command;
    }
39939
private function getInstanceAdminClient()
    {
        //@codeCoverageIgnoreStart
        if ($this->instanceAdminClient) {
            return $this->instanceAdminClient;
        }
        //@codeCoverageIgnoreEnd

        $this->instanceAdminClient = new InstanceAdminClient($this->grpcConfig);

        return $this->instanceAdminClient;
    }
966861
public function getComposition()
    {
        if ($this->_composition === null) {
            $this->_composition = Yii::$app->get('composition');
        }

        return $this->_composition;
    }
1333527
protected function loadComposerJson()
    {
        $composerJsonPath = $this->getComposerJsonPath();

        if (! File::exists($composerJsonPath)) {
            throw new FileNotFoundException('composer.json does not exist');
        }

        $composerJsonContent = File::get($composerJsonPath);
        $composerJson = json_decode($composerJsonContent, true);

        if (! is_array($composerJson)) {
            throw new RuntimeException("Invalid composer.json file [$composerJsonPath]");
        }

        return $composerJson;
    }
18820
private function getLockFile()
    {
        $composerFile = \Composer\Factory::getComposerFile();

        $lockFile = 'json' === pathinfo($composerFile, PATHINFO_EXTENSION)
            ? substr($composerFile, 0, -4) . 'lock'
            : $composerFile . '.lock';

        return new \Composer\Json\JsonFile($lockFile, null, $this->appIO);
    }