nicer key

This commit is contained in:
Thomas Portelange 2023-08-01 14:27:00 +02:00 committed by GitHub
parent 909bee8101
commit d3c2fa897c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,8 +44,7 @@ class VersionProvider
*/
public function getVersion()
{
$key = sprintf('%s-%s', $this->getComposerLockPath(), 'all');
$key = preg_replace("/[^A-Za-z0-9]/", '', $key);
$key = sprintf('%s_%s', preg_replace("/[^A-Za-z0-9]/", '', $this->getComposerLockPath()), 'all');
$version = $this->getCachedValue($key);
if ($version) {
return $version;
@ -81,8 +80,7 @@ class VersionProvider
*/
public function getModuleVersion(string $module): string
{
$key = sprintf('%s-%s', $this->getComposerLockPath(), $module);
$key = preg_replace("/[^A-Za-z0-9]/", '', $key);
$key = sprintf('%s_%s', preg_replace("/[^A-Za-z0-9]/", '', $this->getComposerLockPath()), $module);
$version = $this->getCachedValue($key);
if ($version) {
return $version;