Skip to content

Commit 0150aa3

Browse files
authored
Adds support for additional info in Updater class
Extends the Updater constructor to accept an optional `info` parameter to include additional information about updates. Updates the display logic to show this information in the update details table, improving transparency for users regarding the update process.
1 parent 07aa55a commit 0150aa3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Updater.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ final class Updater
2727
private $clear;
2828
private $maxLogs;
2929
private $archive_relative_paths;
30+
private $info = "";
3031

3132
/**
3233
* Constructs a new instance of the updater class.
@@ -49,7 +50,7 @@ final class Updater
4950
* @param int $maxLogs (Optional) Maximum number of log file to maintain. Defaults to 30.
5051
* @return void
5152
*/
52-
public function __construct(string $username, string $repository, string $token, string $version, string|null $admin = '', string|null $mailer = '', array|null $sourceExclusions = ['path' => [], 'filename' => []], array|null $releaseExclusions = ['path' => [], 'filename' => []], bool $clear = true, string $dir = "", bool $autoUpdate = true, int $maxLogs = 30)
53+
public function __construct(string $username, string $repository, string $token, string $version, string|null $admin = '', string|null $mailer = '', array|null $sourceExclusions = ['path' => [], 'filename' => []], array|null $releaseExclusions = ['path' => [], 'filename' => []], bool $clear = true, string $dir = "", bool $autoUpdate = true, int $maxLogs = 30, string $info = "")
5354
{
5455
if ($admin == null) {
5556
$this->admin = '';
@@ -100,6 +101,7 @@ public function __construct(string $username, string $repository, string $token,
100101
}
101102

102103
$this->maxLogs = $maxLogs;
104+
$this->info = $info;
103105

104106
$this->status = $this::INIT;
105107

@@ -216,6 +218,10 @@ private function Mail()
216218
<td>Plugin Version</td>
217219
<td>' . $this->version . '</td>
218220
</tr>
221+
<tr>
222+
<td>Additional Info</td>
223+
<td>' . $this->info . '</td>
224+
</tr>
219225
</table>
220226
<p>Update Logs:</p>
221227
<table>

0 commit comments

Comments
 (0)