protected function loadComposerFile() {
        $composerFile = $this->config['appDir'] . '/composer.json';

        if (!is_readable($composerFile)) {
            throw new Exception(sprintf(
                'Composer file "%s" is missing or not readable',
                $composerFile
            ), ExitApp::RUNTIME_ERROR);
        }

        $this->config['composer'] = JSONFile::read($composerFile);

        if (!array_key_exists('extra', $this->config['composer']) ||
            !is_array($this->config['composer']['extra'])) {
            throw new Exception(sprintf(
                'Missing "extra" in composer file "%s"',
                $composerFile
            ), ExitApp::RUNTIME_ERROR);
        }

        $keys = [
            'name',
            'version'
        ];

        foreach ($keys as $key) {
            if (!array_key_exists($key, $this->config['composer']['extra'])) {
                throw new Exception(sprintf(
                    'Missing "extra.%s" in composer file "%s"',
                    $key,
                    $composerFile
                ), ExitApp::RUNTIME_ERROR);
            }
        }

        return $this;
    }
protected function loadComposerFile() {
        $composerFile = $this->config['appDir'] . '/composer.json';

        if (!is_readable($composerFile)) {
            throw new Exception(sprintf(
                'Composer file "%s" is missing or not readable',
                $composerFile
            ), ExitApp::RUNTIME_ERROR);
        }

        $this->config['composer'] = JSONFile::read($composerFile);

        if (!array_key_exists('extra', $this->config['composer']) ||
            !is_array($this->config['composer']['extra'])) {
            throw new Exception(sprintf(
                'Missing "extra" in composer file "%s"',
                $composerFile
            ), ExitApp::RUNTIME_ERROR);
        }

        $keys = [
            'name',
            'version'
        ];

        foreach ($keys as $key) {
            if (!array_key_exists($key, $this->config['composer']['extra'])) {
                throw new Exception(sprintf(
                    'Missing "extra.%s" in composer file "%s"',
                    $key,
                    $composerFile
                ), ExitApp::RUNTIME_ERROR);
            }
        }

        return $this;
    }
protected function loadComposerFile ( ) { $ composerFile = $ this -> config [ 'appDir' ] . '/composer.json' ; if ( ! is_readable ( $ composerFile ) ) { throw new Exception ( sprintf ( 'Composer file "%s" is missing or not readable' , $ composerFile ) , ExitApp :: RUNTIME_ERROR ) ; } $ this -> config [ 'composer' ] = JSONFile :: read ( $ composerFile ) ; if ( ! array_key_exists ( 'extra' , $ this -> config [ 'composer' ] ) || ! is_array ( $ this -> config [ 'composer' ] [ 'extra' ] ) ) { throw new Exception ( sprintf ( 'Missing "extra" in composer file "%s"' , $ composerFile ) , ExitApp :: RUNTIME_ERROR ) ; } $ keys = [ 'name' , 'version' ] ; foreach ( $ keys as $ key ) { if ( ! array_key_exists ( $ key , $ this -> config [ 'composer' ] [ 'extra' ] ) ) { throw new Exception ( sprintf ( 'Missing "extra.%s" in composer file "%s"' , $ key , $ composerFile ) , ExitApp :: RUNTIME_ERROR ) ; } } return $ this ; }
Parse composer.json

@return self Returns itself

@throws Exception on error
Parse composer . json