mirror of
https://github.com/flarum/core.git
synced 2025-08-03 23:17:43 +02:00
Remove dead code
This commit is contained in:
@@ -54,24 +54,20 @@ class LastUpdateCheck
|
|||||||
return $core ? $core['latest-major'] : null;
|
return $core ? $core['latest-major'] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function forget(string $name, bool $wildcard = false): void
|
public function forget(string $name): void
|
||||||
{
|
{
|
||||||
$lastUpdateCheck = json_decode($this->settings->get(self::KEY, '{}'), true);
|
$lastUpdateCheck = $this->get();
|
||||||
|
|
||||||
if (isset($lastUpdateCheck['updates']) && ! empty($lastUpdateCheck['updates']['installed'])) {
|
if (isset($lastUpdateCheck['updates']) && ! empty($lastUpdateCheck['updates']['installed'])) {
|
||||||
$updatesListChanged = false;
|
$updatesListChanged = false;
|
||||||
$pattern = str_replace('\*', '.*', preg_quote($name, '/'));
|
|
||||||
|
|
||||||
foreach ($lastUpdateCheck['updates']['installed'] as $k => $package) {
|
foreach ($lastUpdateCheck['updates']['installed'] as $k => $package) {
|
||||||
if (($wildcard && Str::of($package['name'])->test("/($pattern)/")) || $package['name'] === $name) {
|
if ($package['name'] === $name) {
|
||||||
unset($lastUpdateCheck['updates']['installed'][$k]);
|
unset($lastUpdateCheck['updates']['installed'][$k]);
|
||||||
$updatesListChanged = true;
|
$updatesListChanged = true;
|
||||||
|
|
||||||
if (! $wildcard) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($updatesListChanged) {
|
if ($updatesListChanged) {
|
||||||
$lastUpdateCheck['updates']['installed'] = array_values($lastUpdateCheck['updates']['installed']);
|
$lastUpdateCheck['updates']['installed'] = array_values($lastUpdateCheck['updates']['installed']);
|
||||||
|
Reference in New Issue
Block a user