mailpoet
/
vendor
/
woocommerce
/
email-editor
/
src
/
Validator
/
Schema
/
class-integer-schema.php
class-any-of-schema.php
11 months ago
class-array-schema.php
11 months ago
class-boolean-schema.php
11 months ago
class-integer-schema.php
11 months ago
class-null-schema.php
11 months ago
class-number-schema.php
11 months ago
class-object-schema.php
11 months ago
class-one-of-schema.php
11 months ago
class-string-schema.php
11 months ago
index.php
11 months ago
class-integer-schema.php
30 lines
| 1 | <?php |
| 2 | declare( strict_types = 1 ); |
| 3 | namespace Automattic\WooCommerce\EmailEditor\Validator\Schema; |
| 4 | if (!defined('ABSPATH')) exit; |
| 5 | use Automattic\WooCommerce\EmailEditor\Validator\Schema; |
| 6 | class Integer_Schema extends Schema { |
| 7 | protected $schema = array( |
| 8 | 'type' => 'integer', |
| 9 | ); |
| 10 | public function minimum( int $value ): self { |
| 11 | return $this->update_schema_property( 'minimum', $value ) |
| 12 | ->unset_schema_property( 'exclusiveMinimum' ); |
| 13 | } |
| 14 | public function exclusiveMinimum( int $value ): self { |
| 15 | return $this->update_schema_property( 'minimum', $value ) |
| 16 | ->update_schema_property( 'exclusiveMinimum', true ); |
| 17 | } |
| 18 | public function maximum( int $value ): self { |
| 19 | return $this->update_schema_property( 'maximum', $value ) |
| 20 | ->unset_schema_property( 'exclusiveMaximum' ); |
| 21 | } |
| 22 | public function exclusiveMaximum( int $value ): self { |
| 23 | return $this->update_schema_property( 'maximum', $value ) |
| 24 | ->update_schema_property( 'exclusiveMaximum', true ); |
| 25 | } |
| 26 | public function multipleOf( int $value ): self { |
| 27 | return $this->update_schema_property( 'multipleOf', $value ); |
| 28 | } |
| 29 | } |
| 30 |