mirror of
https://github.com/flarum/framework.git
synced 2025-03-30 03:15:13 +08:00
Remove dead code
This commit is contained in:
parent
2e3a78ca2d
commit
c8b8dacb67
@ -54,22 +54,18 @@ class LastUpdateCheck
|
||||
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'])) {
|
||||
$updatesListChanged = false;
|
||||
$pattern = str_replace('\*', '.*', preg_quote($name, '/'));
|
||||
|
||||
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]);
|
||||
$updatesListChanged = true;
|
||||
|
||||
if (! $wildcard) {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user