GrumPHP\Console\Application::initializeComposerHelper PHP Method

initializeComposerHelper() protected method

protected initializeComposerHelper ( ) : ComposerHelper
return GrumPHP\Console\Helper\ComposerHelper
    protected function initializeComposerHelper()
    {
        if ($this->composerHelper) {
            return $this->composerHelper;
        }
        try {
            $composerFile = getcwd() . DIRECTORY_SEPARATOR . 'composer.json';
            $configuration = Composer::loadConfiguration();
            Composer::ensureProjectBinDirInSystemPath($configuration->get('bin-dir'));
            $rootPackage = Composer::loadRootPackageFromJson($composerFile, $configuration);
        } catch (RuntimeException $e) {
            $configuration = null;
            $rootPackage = null;
        }
        return $this->composerHelper = new Helper\ComposerHelper($configuration, $rootPackage);
    }