Skip to content

Commit bd04791

Browse files
authored
Merge pull request #61 from ohdearapp/bugfix/uptime-percentage-float
fix: resolve uptime percentage as float
2 parents 8cb9d9a + 4d7f24f commit bd04791

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Dto/Uptime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Uptime
1010
{
1111
public function __construct(
1212
public string $datetime,
13-
public int $uptimePercentage,
13+
public float $uptimePercentage,
1414
) {}
1515

1616
public static function fromResponse(array $data): self

tests/OhDearTests/UptimeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919

2020
foreach ($uptimePeriods as $uptime) {
2121
expect($uptime->datetime)->toBeString();
22-
expect($uptime->uptimePercentage)->toBeInt();
22+
expect($uptime->uptimePercentage)->toBeFloat();
2323
}
2424
});

0 commit comments

Comments
 (0)