Skip to content

Commit 39ecdf0

Browse files
committed
level 6
1 parent 521abbd commit 39ecdf0

File tree

368 files changed

+2644
-1278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

368 files changed

+2644
-1278
lines changed

app/Actions/CronJob/CreateCronJob.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
class CreateCronJob
1212
{
13+
/**
14+
* @param array<string, mixed> $input
15+
*/
1316
public function create(Server $server, array $input): CronJob
1417
{
1518
$cronJob = new CronJob([
@@ -28,6 +31,10 @@ public function create(Server $server, array $input): CronJob
2831
return $cronJob;
2932
}
3033

34+
/**
35+
* @param array<string, mixed> $input
36+
* @return array<string, array<mixed>>
37+
*/
3138
public static function rules(array $input, Server $server): array
3239
{
3340
$rules = [

app/Actions/Database/CreateDatabase.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
class CreateDatabase
1212
{
13+
/**
14+
* @param array<string, mixed> $input
15+
*/
1316
public function create(Server $server, array $input): Database
1417
{
1518
$database = new Database([
@@ -34,6 +37,9 @@ public function create(Server $server, array $input): Database
3437
}
3538

3639
/**
40+
* @param array<string, mixed> $input
41+
* @return array<string, mixed>
42+
*
3743
* @throws ValidationException
3844
*/
3945
public static function rules(Server $server, array $input): array

app/Actions/Database/CreateDatabaseUser.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
class CreateDatabaseUser
1313
{
1414
/**
15+
* @param array<string, mixed> $input
16+
* @param array<string> $links
17+
*
1518
* @throws ValidationException
1619
*/
1720
public function create(Server $server, array $input, array $links = []): DatabaseUser
@@ -41,6 +44,9 @@ public function create(Server $server, array $input, array $links = []): Databas
4144
}
4245

4346
/**
47+
* @param array<string, mixed> $input
48+
* @return array<string, mixed>
49+
*
4450
* @throws ValidationException
4551
*/
4652
public static function rules(Server $server, array $input): array

app/Actions/Database/LinkUser.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
class LinkUser
1212
{
1313
/**
14+
* @param array<string, mixed> $input
15+
* @return DatabaseUser $databaseUser
16+
*
1417
* @throws ValidationException
1518
*/
1619
public function link(DatabaseUser $databaseUser, array $input): DatabaseUser
@@ -49,6 +52,10 @@ public function link(DatabaseUser $databaseUser, array $input): DatabaseUser
4952
return $databaseUser;
5053
}
5154

55+
/**
56+
* @param array<string, mixed> $input
57+
* @return array<string, mixed>
58+
*/
5259
public static function rules(Server $server, array $input): array
5360
{
5461
return [

app/Actions/Database/ManageBackup.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
class ManageBackup
1515
{
1616
/**
17+
* @param array<string, mixed> $input
18+
*
1719
* @throws AuthorizationException
1820
* @throws ValidationException
1921
*/
@@ -35,6 +37,9 @@ public function create(Server $server, array $input): Backup
3537
return $backup;
3638
}
3739

40+
/**
41+
* @param array<string, mixed> $input
42+
*/
3843
public function update(Backup $backup, array $input): void
3944
{
4045
$backup->interval = $input['interval'] == 'custom' ? $input['custom_interval'] : $input['interval'];
@@ -47,7 +52,7 @@ public function delete(Backup $backup): void
4752
$backup->status = BackupStatus::DELETING;
4853
$backup->save();
4954

50-
dispatch(function () use ($backup) {
55+
dispatch(function () use ($backup): void {
5156
$files = $backup->files;
5257
foreach ($files as $file) {
5358
$file->status = BackupFileStatus::DELETING;
@@ -60,6 +65,10 @@ public function delete(Backup $backup): void
6065
});
6166
}
6267

68+
/**
69+
* @param array<string, mixed> $input
70+
* @return array<string, mixed>
71+
*/
6372
public static function rules(Server $server, array $input): array
6473
{
6574
$rules = [

app/Actions/Database/ManageBackupFile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function delete(BackupFile $file): void
2828
$file->status = BackupFileStatus::DELETING;
2929
$file->save();
3030

31-
dispatch(function () use ($file) {
31+
dispatch(function () use ($file): void {
3232
$file->deleteFile();
3333
});
3434
}

app/Actions/Database/RestoreBackup.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
class RestoreBackup
1010
{
11+
/**
12+
* @param array<string, mixed> $input
13+
*/
1114
public function restore(BackupFile $backupFile, array $input): void
1215
{
1316
/** @var Database $database */
@@ -16,19 +19,22 @@ public function restore(BackupFile $backupFile, array $input): void
1619
$backupFile->restored_to = $database->name;
1720
$backupFile->save();
1821

19-
dispatch(function () use ($backupFile, $database) {
22+
dispatch(function () use ($backupFile, $database): void {
2023
/** @var \App\SSH\Services\Database\Database $databaseHandler */
2124
$databaseHandler = $database->server->database()->handler();
2225
$databaseHandler->restoreBackup($backupFile, $database->name);
2326
$backupFile->status = BackupFileStatus::RESTORED;
2427
$backupFile->restored_at = now();
2528
$backupFile->save();
26-
})->catch(function () use ($backupFile) {
29+
})->catch(function () use ($backupFile): void {
2730
$backupFile->status = BackupFileStatus::RESTORE_FAILED;
2831
$backupFile->save();
2932
})->onConnection('ssh');
3033
}
3134

35+
/**
36+
* @return array<string, array<string>>
37+
*/
3238
public static function rules(): array
3339
{
3440
return [

app/Actions/Database/RunBackup.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function run(Backup $backup): BackupFile
2020
]);
2121
$file->save();
2222

23-
dispatch(function () use ($file, $backup) {
23+
dispatch(function () use ($file, $backup): void {
2424
/** @var Database $databaseHandler */
2525
$databaseHandler = $file->backup->server->database()->handler();
2626
$databaseHandler->runBackup($file);
@@ -31,7 +31,7 @@ public function run(Backup $backup): BackupFile
3131
$backup->status = BackupStatus::RUNNING;
3232
$backup->save();
3333
}
34-
})->catch(function () use ($file, $backup) {
34+
})->catch(function () use ($file, $backup): void {
3535
$backup->status = BackupStatus::FAILED;
3636
$backup->save();
3737
$file->status = BackupFileStatus::FAILED;

app/Actions/FileManager/FetchFiles.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
class FetchFiles
1212
{
1313
/**
14+
* @param array<string, mixed> $input
15+
*
1416
* @throws SSHError
1517
*/
1618
public function fetch(User $user, Server $server, array $input): void
@@ -24,6 +26,9 @@ public function fetch(User $user, Server $server, array $input): void
2426
);
2527
}
2628

29+
/**
30+
* @return array<string, array<string>>
31+
*/
2732
public static function rules(Server $server): array
2833
{
2934
return [

app/Actions/FirewallRule/ManageRule.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
class ManageRule
1111
{
12+
/**
13+
* @param array<string, mixed> $input
14+
* @return FirewallRule $rule
15+
*/
1216
public function create(Server $server, array $input): FirewallRule
1317
{
1418
$sourceAny = $input['source_any'] ?? empty($input['source'] ?? null);
@@ -30,6 +34,10 @@ public function create(Server $server, array $input): FirewallRule
3034
return $rule;
3135
}
3236

37+
/**
38+
* @param array<string, mixed> $input
39+
* @return FirewallRule $rule
40+
*/
3341
public function update(FirewallRule $rule, array $input): FirewallRule
3442
{
3543
$sourceAny = $input['source_any'] ?? empty($input['source'] ?? null);
@@ -56,7 +64,7 @@ public function delete(FirewallRule $rule): void
5664
dispatch(fn () => $this->applyRule($rule));
5765
}
5866

59-
protected function applyRule($rule): void
67+
protected function applyRule(FirewallRule $rule): void
6068
{
6169
try {
6270
/** @var Firewall $handler */
@@ -80,6 +88,9 @@ protected function applyRule($rule): void
8088
$rule->save();
8189
}
8290

91+
/**
92+
* @return array<string, array<string>>
93+
*/
8394
public static function rules(): array
8495
{
8596
return [

0 commit comments

Comments
 (0)