blob: 74a3409b1252b91e46069389d3036434f26cd662 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
<?php
declare(strict_types=1);
namespace Nsfisis\Waddiwasi\WebAssembly\Structure\Types;
final readonly class Limits
{
/**
* @param U32 $min
* @param ?U32 $max
*/
public function __construct(
public int $min,
public ?int $max,
) {
}
public function isValid(): bool
{
return $this->min >= 0 &&
($this->max === null || $this->min <= $this->max);
}
}
|