@@ -115,6 +115,7 @@ public function unpack(Operation $op, Result $result = null): Result
115
115
public function updateLock (Result $ result , IOInterface $ io ): void
116
116
{
117
117
$ json = new JsonFile (Factory::getComposerFile ());
118
+ $ jsonContent = file_get_contents ($ json ->getPath ());
118
119
$ manipulator = new JsonConfigSource ($ json );
119
120
$ locker = $ this ->composer ->getLocker ();
120
121
$ lockData = $ locker ->getLockData ();
@@ -135,7 +136,7 @@ public function updateLock(Result $result, IOInterface $io): void
135
136
}
136
137
$ lockData ['packages ' ] = array_values ($ lockData ['packages ' ]);
137
138
$ lockData ['packages-dev ' ] = array_values ($ lockData ['packages-dev ' ]);
138
- $ lockData ['content-hash ' ] = $ locker ->getContentHash (file_get_contents ( $ json -> getPath ()) );
139
+ $ lockData ['content-hash ' ] = $ locker ->getContentHash ($ jsonContent );
139
140
$ lockFile = new JsonFile (substr ($ json ->getPath (), 0 , -4 ).'lock ' , null , $ io );
140
141
141
142
if (!$ this ->dryRun ) {
@@ -144,9 +145,9 @@ public function updateLock(Result $result, IOInterface $io): void
144
145
145
146
// force removal of files under vendor/
146
147
if (version_compare ('2.0.0 ' , PluginInterface::PLUGIN_API_VERSION , '> ' )) {
147
- $ locker = new Locker ($ io , $ lockFile , $ this ->composer ->getRepositoryManager (), $ this ->composer ->getInstallationManager (), file_get_contents ( $ json -> getPath ()) );
148
+ $ locker = new Locker ($ io , $ lockFile , $ this ->composer ->getRepositoryManager (), $ this ->composer ->getInstallationManager (), $ jsonContent );
148
149
} else {
149
- $ locker = new Locker ($ io , $ lockFile , $ this ->composer ->getInstallationManager (), file_get_contents ( $ json -> getPath ()) );
150
+ $ locker = new Locker ($ io , $ lockFile , $ this ->composer ->getInstallationManager (), $ jsonContent );
150
151
}
151
152
$ this ->composer ->setLocker ($ locker );
152
153
}
0 commit comments