private function getComposerContentHash($composerJsonFileContents)
    {
        $composerConfig = json_decode($composerJsonFileContents, true);

        $relevantKeys = array(
            'name',
            'version',
            'require',
            'require-dev',
            'conflict',
            'replace',
            'provide',
            'minimum-stability',
            'prefer-stable',
            'repositories',
            'extra',
        );

        $relevantComposerConfig = array();

        foreach (array_intersect($relevantKeys, array_keys($composerConfig)) as $key) {
            $relevantComposerConfig[$key] = $composerConfig[$key];
        }

        if (isset($composerConfig['config']['platform'])) {
            $relevantComposerConfig['config']['platform'] = $composerConfig['config']['platform'];
        }

        ksort($relevantComposerConfig);

        return md5(json_encode($relevantComposerConfig));
    }