@@ -133,9 +133,10 @@ public function updateLock(Result $result, IOInterface $io): void
133
133
}
134
134
}
135
135
}
136
+ $ jsonContent = file_get_contents ($ json ->getPath ());
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