Refactor
This commit is contained in:
parent
b4cc63387b
commit
195d5e4609
2 changed files with 6 additions and 3 deletions
|
@ -14,8 +14,13 @@ class Options
|
|||
{
|
||||
public bool $updateAvailable = false;
|
||||
|
||||
public string $version;
|
||||
|
||||
public function __construct(private Database $database)
|
||||
{
|
||||
$this->version = $this->getOption('version')
|
||||
? $this->getOption('version')
|
||||
: '0.1.0';
|
||||
}
|
||||
|
||||
public function getOption(string $key): string
|
||||
|
|
|
@ -73,9 +73,7 @@ if (!$options) {
|
|||
* Update
|
||||
*/
|
||||
if ($options) {
|
||||
$version_current = $options->getOption('version') ?? '0.0.0';
|
||||
|
||||
if (-1 === version_compare($version_current, $version_new)) {
|
||||
if (-1 === version_compare($options->version, $version_new)) {
|
||||
$options->updateAvailable = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue