@@ -19,10 +19,10 @@ $data = $schema->parse(4.2); // Returns: 4.2
1919### Comparison Constraints
2020
2121``` php
22- $schema->gt (5.0); // Greater than 5.0
23- $schema->gte (5.0); // Greater than or equal to 5.0
24- $schema->lt (10.0); // Less than 10.0
25- $schema->lte (10.0); // Less than or equal to 10.0
22+ $schema->minimum (5.0); // Greater than or equal to 5.0
23+ $schema->exclusiveMinimum (5.0); // Greater than 5.0
24+ $schema->exclusiveMaximum (10.0); // Less than 10.0
25+ $schema->maximum (10.0); // Less than or equal to 10.0
2626```
2727
2828### Sign Constraints
@@ -56,17 +56,18 @@ $priceSchema->parse(-5.0); // Throws: nonNegative validation error
5656### Percentage
5757
5858``` php
59- $percentageSchema = $p->float()->gte (0.0)->lte (100.0);
59+ $percentageSchema = $p->float()->minimum (0.0)->maximum (100.0);
6060
6161$percentageSchema->parse(75.5); // Returns: 75.5
62- $percentageSchema->parse(150.0); // Throws: lte validation error
62+ $percentageSchema->parse(-1.0); // Throws: minimum validation error
63+ $percentageSchema->parse(150.0); // Throws: maximum validation error
6364```
6465
6566### Coordinates
6667
6768``` php
68- $latitudeSchema = $p->float()->gte (-90.0)->lte (90.0);
69- $longitudeSchema = $p->float()->gte (-180.0)->lte (180.0);
69+ $latitudeSchema = $p->float()->minimum (-90.0)->maximum (90.0);
70+ $longitudeSchema = $p->float()->minimum (-180.0)->maximum (180.0);
7071
7172$coordinatesSchema = $p->object([
7273 'lat' => $latitudeSchema,
@@ -81,8 +82,8 @@ $coordinatesSchema->parse(['lat' => 47.1, 'lng' => 8.2]);
8182| Code | Description |
8283| ------| -------------|
8384| ` float.type ` | Value is not a float |
84- | ` float.gt ` | Value is not greater than threshold (used by ` gt() ` and ` positive ()` ) |
85- | ` float.gte ` | Value is not greater than or equal to threshold (used by ` gte ()` and ` nonNegative ()` ) |
86- | ` float.lt ` | Value is not less than threshold (used by ` lt ()` and ` negative() ` ) |
87- | ` float.lte ` | Value is not less than or equal to threshold (used by ` lte ()` and ` nonPositive() ` ) |
85+ | ` float.minimum ` | Value is not greater than or equal to threshold (used by ` minimum ` and ` nonNegative ()` ) |
86+ | ` float.exclusiveMinimum ` | Value is not greater than threshold (used by ` exclusiveMinimum ()` and ` positive ()` ) |
87+ | ` float.exclusiveMaximum ` | Value is not less than threshold (used by ` exclusiveMaximum ()` and ` negative() ` ) |
88+ | ` float.maximum ` | Value is not less than or equal to threshold (used by ` maximum ()` and ` nonPositive() ` ) |
8889| ` float.int ` | Cannot convert float to int without precision loss (for ` toInt() ` ) |
0 commit comments