private function getConfigFileHash(string $path) : string
    {
        $content         = json_decode($this->loadFile($path . DIRECTORY_SEPARATOR . 'composer.json'), true);
        $relevantContent = [];

        foreach (array_intersect($this->relevantKeys, array_keys($content)) as $key) {
            $relevantContent[$key] = $content[$key];
        }
        if (isset($content['config']['platform'])) {
            $relevantContent['config']['platform'] = $content['config']['platform'];
        }
        ksort($relevantContent);

        return md5((string)json_encode($relevantContent));
    }
private function getConfigFileHash(string $path) : string
    {
        $content         = json_decode($this->loadFile($path . DIRECTORY_SEPARATOR . 'composer.json'), true);
        $relevantContent = [];

        foreach (array_intersect($this->relevantKeys, array_keys($content)) as $key) {
            $relevantContent[$key] = $content[$key];
        }
        if (isset($content['config']['platform'])) {
            $relevantContent['config']['platform'] = $content['config']['platform'];
        }
        ksort($relevantContent);

        return md5((string)json_encode($relevantContent));
    }
private function getConfigFileHash ( string $ path ) : string { $ content = json_decode ( $ this -> loadFile ( $ path . DIRECTORY_SEPARATOR . 'composer.json' ) , true ) ; $ relevantContent = [ ] ; foreach ( array_intersect ( $ this -> relevantKeys , array_keys ( $ content ) ) as $ key ) { $ relevantContent [ $ key ] = $ content [ $ key ] ; } if ( isset ( $ content [ 'config' ] [ 'platform' ] ) ) { $ relevantContent [ 'config' ] [ 'platform' ] = $ content [ 'config' ] [ 'platform' ] ; } ksort ( $ relevantContent ) ; return md5 ( ( string ) json_encode ( $ relevantContent ) ) ; }
Read the composer.json file and create a md5 hash on its relevant content

This more or less is composer internal code to generate the content-hash so this might not be the best idea
and will be removed in the future.

@param  string $path
@return string
@throws \Exception
Read the composer . json file and create a md5 hash on its relevant content