dev/src/ReleaseBuilder/ReleaseBuilder.php
private function getCommitComponentModifiedList($url)
    {
        $commit = json_decode($this->http->get($url, [
            'auth' => [null, $this->token]
        ])->getBody(), true);

        $changedComponents = [];
        $fileDirectoryComponent = [];
        foreach ($commit['files'] as $file) {
            $filename = $file['filename'];
            if (strpos($filename, '/') === false) {
                continue;
            }

            $fileParts = explode('/', $filename);
            $componentDirectory = $fileParts[0];

            $composerPath = $this->rootPath .'/'. $componentDirectory .'/composer.json';
            if (!array_key_exists($composerPath, $fileDirectoryComponent)) {
                if (!file_exists($composerPath)) {
                    continue;
                }

                $composer = json_decode(file_get_contents($composerPath), true)['extra']['component'];
                $fileDirectoryComponent[$composerPath] = $composer;
            } else {
                $composer = $fileDirectoryComponent[$composerPath];
            }

            if (!isset($changedComponents[$composer['id']])) {
                $changedComponents[$composer['id']] = [
                    'files' => [],
                    'level' => 'minor'
                ];
            }

            $changedComponents[$composer['id']]['files'][] = $file['filename'];
        }

        return $changedComponents;
    }
private function getCommitComponentModifiedList($url)
    {
        $commit = json_decode($this->http->get($url, [
            'auth' => [null, $this->token]
        ])->getBody(), true);

        $changedComponents = [];
        $fileDirectoryComponent = [];
        foreach ($commit['files'] as $file) {
            $filename = $file['filename'];
            if (strpos($filename, '/') === false) {
                continue;
            }

            $fileParts = explode('/', $filename);
            $componentDirectory = $fileParts[0];

            $composerPath = $this->rootPath .'/'. $componentDirectory .'/composer.json';
            if (!array_key_exists($composerPath, $fileDirectoryComponent)) {
                if (!file_exists($composerPath)) {
                    continue;
                }

                $composer = json_decode(file_get_contents($composerPath), true)['extra']['component'];
                $fileDirectoryComponent[$composerPath] = $composer;
            } else {
                $composer = $fileDirectoryComponent[$composerPath];
            }

            if (!isset($changedComponents[$composer['id']])) {
                $changedComponents[$composer['id']] = [
                    'files' => [],
                    'level' => 'minor'
                ];
            }

            $changedComponents[$composer['id']]['files'][] = $file['filename'];
        }

        return $changedComponents;
    }
private function getCommitComponentModifiedList ( $ url ) { $ commit = json_decode ( $ this -> http -> get ( $ url , [ 'auth' => [ null , $ this -> token ] ] ) -> getBody ( ) , true ) ; $ changedComponents = [ ] ; $ fileDirectoryComponent = [ ] ; foreach ( $ commit [ 'files' ] as $ file ) { $ filename = $ file [ 'filename' ] ; if ( strpos ( $ filename , '/' ) === false ) { continue ; } $ fileParts = explode ( '/' , $ filename ) ; $ componentDirectory = $ fileParts [ 0 ] ; $ composerPath = $ this -> rootPath . '/' . $ componentDirectory . '/composer.json' ; if ( ! array_key_exists ( $ composerPath , $ fileDirectoryComponent ) ) { if ( ! file_exists ( $ composerPath ) ) { continue ; } $ composer = json_decode ( file_get_contents ( $ composerPath ) , true ) [ 'extra' ] [ 'component' ] ; $ fileDirectoryComponent [ $ composerPath ] = $ composer ; } else { $ composer = $ fileDirectoryComponent [ $ composerPath ] ; } if ( ! isset ( $ changedComponents [ $ composer [ 'id' ] ] ) ) { $ changedComponents [ $ composer [ 'id' ] ] = [ 'files' => [ ] , 'level' => 'minor' ] ; } $ changedComponents [ $ composer [ 'id' ] ] [ 'files' ] [ ] = $ file [ 'filename' ] ; } return $ changedComponents ; }
Query the github API for a list of files modified by a commit.

@param string $url The URL to the commit.
@return array A list of files.
Query the github API for a list of files modified by a commit .