|
10 | 10 | /** |
11 | 11 | * @property int $id |
12 | 12 | * @property int $server_id |
13 | | - * @property float $load |
14 | | - * @property float $memory_total |
15 | | - * @property float $memory_used |
16 | | - * @property float $memory_free |
17 | | - * @property float $disk_total |
18 | | - * @property float $disk_used |
19 | | - * @property float $disk_free |
| 13 | + * @property ?float $load |
| 14 | + * @property ?float $memory_total |
| 15 | + * @property ?float $memory_used |
| 16 | + * @property ?float $memory_free |
| 17 | + * @property ?float $disk_total |
| 18 | + * @property ?float $disk_used |
| 19 | + * @property ?float $disk_free |
20 | 20 | * @property-read float|int $memory_total_in_bytes |
21 | 21 | * @property-read float|int $memory_used_in_bytes |
22 | 22 | * @property-read float|int $memory_free_in_bytes |
@@ -60,31 +60,31 @@ public function server(): BelongsTo |
60 | 60 |
|
61 | 61 | public function getMemoryTotalInBytesAttribute(): float|int |
62 | 62 | { |
63 | | - return $this->memory_total * 1024; |
| 63 | + return ($this->memory_total ?? 0) * 1024; |
64 | 64 | } |
65 | 65 |
|
66 | 66 | public function getMemoryUsedInBytesAttribute(): float|int |
67 | 67 | { |
68 | | - return $this->memory_used * 1024; |
| 68 | + return ($this->memory_used ?? 0) * 1024; |
69 | 69 | } |
70 | 70 |
|
71 | 71 | public function getMemoryFreeInBytesAttribute(): float|int |
72 | 72 | { |
73 | | - return $this->memory_free * 1024; |
| 73 | + return ($this->memory_free ?? 0) * 1024; |
74 | 74 | } |
75 | 75 |
|
76 | 76 | public function getDiskTotalInBytesAttribute(): float|int |
77 | 77 | { |
78 | | - return $this->disk_total * (1024 * 1024); |
| 78 | + return ($this->disk_total ?? 0) * (1024 * 1024); |
79 | 79 | } |
80 | 80 |
|
81 | 81 | public function getDiskUsedInBytesAttribute(): float|int |
82 | 82 | { |
83 | | - return $this->disk_used * (1024 * 1024); |
| 83 | + return ($this->disk_used ?? 0) * (1024 * 1024); |
84 | 84 | } |
85 | 85 |
|
86 | 86 | public function getDiskFreeInBytesAttribute(): float|int |
87 | 87 | { |
88 | | - return $this->disk_free * (1024 * 1024); |
| 88 | + return ($this->disk_free ?? 0) * (1024 * 1024); |
89 | 89 | } |
90 | 90 | } |
0 commit comments