From 0147fe89b6590f48b85d1c7dd2a51ceaa719d2bb Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 15 Dec 2020 16:20:16 +0100 Subject: [PATCH] Structure: range is ?int, ?int [Closes #20] --- src/Schema/Elements/Structure.php | 6 +++--- src/Schema/Elements/Type.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Schema/Elements/Structure.php b/src/Schema/Elements/Structure.php index f0d187d..f8dd287 100644 --- a/src/Schema/Elements/Structure.php +++ b/src/Schema/Elements/Structure.php @@ -26,7 +26,7 @@ final class Structure implements Schema /** @var Schema|null for array|list */ private $otherItems; - /** @var array */ + /** @var array{?int, ?int} */ private $range = [null, null]; @@ -47,14 +47,14 @@ public function default($value): self } - public function min(?float $min): self + public function min(?int $min): self { $this->range[0] = $min; return $this; } - public function max(?float $max): self + public function max(?int $max): self { $this->range[1] = $max; return $this; diff --git a/src/Schema/Elements/Type.php b/src/Schema/Elements/Type.php index 92f80e2..5bc92e0 100644 --- a/src/Schema/Elements/Type.php +++ b/src/Schema/Elements/Type.php @@ -27,7 +27,7 @@ final class Type implements Schema /** @var Schema|null for arrays */ private $items; - /** @var array */ + /** @var array{?float, ?float} */ private $range = [null, null]; /** @var string|null */