Skip to content

Commit 203e4b6

Browse files
committed
style: format and lint using mago
1 parent 1a54e38 commit 203e4b6

File tree

87 files changed

+299
-190
lines changed

Some content is hidden

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

87 files changed

+299
-190
lines changed

app/Analytics/AnalyticsConfig.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ final class AnalyticsConfig
66
{
77
public function __construct(
88
private(set) string $accessLogPath,
9-
) {}
10-
}
9+
) {
10+
}
11+
}

app/Analytics/Chart.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
public function __construct(
1010
public ArrayHelper $labels,
1111
public ArrayHelper $values,
12-
) {}
13-
}
12+
) {
13+
}
14+
}

app/Analytics/PackageDownloadsListed.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public function __construct(
2020
$this->uuid = Uuid::v4()->toString();
2121
}
2222

23+
#[\Override]
2324
public function serialize(): string
2425
{
2526
return json_encode([
@@ -31,6 +32,7 @@ public function serialize(): string
3132
'total' => $this->total,
3233
]);
3334
}
35+
#[\Override]
3436
public static function unserialize(string $payload): self
3537
{
3638
$data = json_decode($payload, true);
@@ -47,4 +49,4 @@ public static function unserialize(string $payload): self
4749

4850
return $self;
4951
}
50-
}
52+
}

app/Analytics/PackageDownloadsPerDay/CreatePackageDownloadsPerDayTable.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ final class CreatePackageDownloadsPerDayTable implements DatabaseMigration
1111
{
1212
public string $name = '2024-12-14_01_create_package_downloads_per_day_table';
1313

14-
public function up(): QueryStatement|null
14+
#[\Override]
15+
public function up(): ?QueryStatement
1516
{
1617
return CreateTableStatement::forModel(PackageDownloadsPerDay::class)
1718
->primary()
@@ -21,8 +22,9 @@ public function up(): QueryStatement|null
2122
->unique('date', 'package');
2223
}
2324

24-
public function down(): QueryStatement|null
25+
#[\Override]
26+
public function down(): ?QueryStatement
2527
{
2628
return DropTableStatement::forModel(PackageDownloadsPerDay::class);
2729
}
28-
}
30+
}

app/Analytics/PackageDownloadsPerDay/PackageDownloadsPerDay.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ public function __construct(
1515
public string $package,
1616
public int $count,
1717
public int $total,
18-
) {}
19-
}
18+
) {
19+
}
20+
}

app/Analytics/PackageDownloadsPerDay/PackageDownloadsPerDayProjector.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@
99

1010
final readonly class PackageDownloadsPerDayProjector implements Projector
1111
{
12+
#[\Override]
1213
public function clear(): void
1314
{
1415
$query = new Query(sprintf(
15-
"DELETE FROM %s",
16+
'DELETE FROM %s',
1617
PackageDownloadsPerDay::table(),
1718
));
1819

1920
$query->execute();
2021
}
2122

23+
#[\Override]
2224
public function replay(object $event): void
2325
{
2426
if ($event instanceof PackageDownloadsListed) {
@@ -44,4 +46,4 @@ public function onPackageDownloadsListed(PackageDownloadsListed $event): void
4446
],
4547
);
4648
}
47-
}
49+
}

app/Analytics/PackageDownloadsPerDay/UpdatePackageDownloadsPerDayTable.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ final class UpdatePackageDownloadsPerDayTable implements DatabaseMigration
1212
{
1313
public string $name = '2024-12-14_03_update_package_downloads_per_day_table';
1414

15-
public function up(): QueryStatement|null
15+
#[\Override]
16+
public function up(): ?QueryStatement
1617
{
1718
return AlterTableStatement::forModel(PackageDownloadsPerDay::class)
1819
->add(new IntegerStatement('total', default: 0));
1920
}
2021

21-
public function down(): QueryStatement|null
22+
#[\Override]
23+
public function down(): ?QueryStatement
2224
{
2325
return null;
2426
}
25-
}
27+
}

app/Analytics/PackageDownloadsPerHour/CreatePackageDownloadsPerHourTable.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ final class CreatePackageDownloadsPerHourTable implements DatabaseMigration
1111
{
1212
public string $name = '2024-12-14_01_create_package_downloads_per_hour_table';
1313

14-
public function up(): QueryStatement|null
14+
#[\Override]
15+
public function up(): ?QueryStatement
1516
{
1617
return CreateTableStatement::forModel(PackageDownloadsPerHour::class)
1718
->primary()
@@ -21,8 +22,9 @@ public function up(): QueryStatement|null
2122
->unique('date', 'package');
2223
}
2324

24-
public function down(): QueryStatement|null
25+
#[\Override]
26+
public function down(): ?QueryStatement
2527
{
2628
return DropTableStatement::forModel(PackageDownloadsPerHour::class);
2729
}
28-
}
30+
}

app/Analytics/PackageDownloadsPerHour/PackageDownloadsPerHour.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ public function __construct(
1515
public string $package,
1616
public int $count,
1717
public int $total,
18-
) {}
19-
}
18+
) {
19+
}
20+
}

app/Analytics/PackageDownloadsPerHour/PackageDownloadsPerHourProjector.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@
99

1010
final readonly class PackageDownloadsPerHourProjector implements Projector
1111
{
12+
#[\Override]
1213
public function clear(): void
1314
{
1415
$query = new Query(sprintf(
15-
"DELETE FROM %s",
16+
'DELETE FROM %s',
1617
PackageDownloadsPerHour::table(),
1718
));
1819

1920
$query->execute();
2021
}
2122

23+
#[\Override]
2224
public function replay(object $event): void
2325
{
2426
if ($event instanceof PackageDownloadsListed) {
@@ -46,4 +48,4 @@ public function onPackageDownloadsListed(PackageDownloadsListed $event): void
4648
],
4749
);
4850
}
49-
}
51+
}

0 commit comments

Comments
 (0)