private function syncComposerLockFile()
    {
        $composerJsonFileContents = file_get_contents($this->projectDir.'/composer.json');
        $composerLockFileContents = json_decode(file_get_contents($this->projectDir.'/composer.lock'), true);

        if (array_key_exists('hash', $composerLockFileContents)) {
            $composerLockFileContents['hash'] = md5($composerJsonFileContents);
        }

        if (array_key_exists('content-hash', $composerLockFileContents)) {
            $composerLockFileContents['content-hash'] = $this->getComposerContentHash($composerJsonFileContents);
        }

        $this->fs->dumpFile($this->projectDir.'/composer.lock', json_encode($composerLockFileContents, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)."\n");
    }
private function syncComposerLockFile()
    {
        $composerJsonFileContents = file_get_contents($this->projectDir.'/composer.json');
        $composerLockFileContents = json_decode(file_get_contents($this->projectDir.'/composer.lock'), true);

        if (array_key_exists('hash', $composerLockFileContents)) {
            $composerLockFileContents['hash'] = md5($composerJsonFileContents);
        }

        if (array_key_exists('content-hash', $composerLockFileContents)) {
            $composerLockFileContents['content-hash'] = $this->getComposerContentHash($composerJsonFileContents);
        }

        $this->fs->dumpFile($this->projectDir.'/composer.lock', json_encode($composerLockFileContents, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)."\n");
    }
private function syncComposerLockFile ( ) { $ composerJsonFileContents = file_get_contents ( $ this -> projectDir . '/composer.json' ) ; $ composerLockFileContents = json_decode ( file_get_contents ( $ this -> projectDir . '/composer.lock' ) , true ) ; if ( array_key_exists ( 'hash' , $ composerLockFileContents ) ) { $ composerLockFileContents [ 'hash' ] = md5 ( $ composerJsonFileContents ) ; } if ( array_key_exists ( 'content-hash' , $ composerLockFileContents ) ) { $ composerLockFileContents [ 'content-hash' ] = $ this -> getComposerContentHash ( $ composerJsonFileContents ) ; } $ this -> fs -> dumpFile ( $ this -> projectDir . '/composer.lock' , json_encode ( $ composerLockFileContents , JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ) . "\n" ) ; }
Updates the hash values stored in composer.lock to avoid out-of-sync
problems when the composer.json file contents are changed.
Updates the hash values stored in composer . lock to avoid out - of - sync problems when the composer . json file contents are changed .