Skip to content

Commit b3b7449

Browse files
committed
update Updater.php
1 parent 225af6c commit b3b7449

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

src/Updater.php

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,18 @@ final class Updater
4242
public function __construct(string $username, string $repository, string $token, string $version, string|null $admin = '', string|null $mailer = '', array|null $exclude = ['path' => [], 'filename' => []])
4343
{
4444
$this->status = $this::STARTED;
45-
$this->username = $username;
46-
$this->repository = $repository;
47-
$this->token = $token;
48-
$this->version = $version;
49-
$this->admin = $admin;
50-
$this->mailer = $mailer;
51-
$this->dir = getcwd();
45+
46+
if ($admin == null) {
47+
$this->admin = '';
48+
}
49+
50+
if ($mailer == null) {
51+
$this->mailer = '';
52+
}
53+
54+
if ($exclude == null) {
55+
$exclude = [];
56+
}
5257

5358
if (!isset($exclude['path'])) {
5459
$exclude['path'] = [];
@@ -57,8 +62,16 @@ public function __construct(string $username, string $repository, string $token,
5762
$exclude['filename'] = [];
5863
}
5964

65+
$this->username = $username;
66+
$this->repository = $repository;
67+
$this->token = $token;
68+
$this->version = $version;
69+
$this->admin = $admin;
70+
$this->mailer = $mailer;
6071
$this->exclude = $exclude;
6172

73+
$this->dir = getcwd();
74+
6275
$update = $this->Install();
6376

6477
if ($update == $this::ERROR) {

0 commit comments

Comments
 (0)