Server IP : 104.21.14.103 / Your IP : 3.22.130.108 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/home/giankuin/thietke365.net/wp-content/plugins/mailpoet/lib/Validator/Schema/ |
Upload File : |
<?php declare(strict_types = 1); namespace MailPoet\Validator\Schema; if (!defined('ABSPATH')) exit; use MailPoet\Validator\Schema; // See: https://developer.wordpress.org/rest-api/extending-the-rest-api/schema/#strings class StringSchema extends Schema { protected $schema = [ 'type' => 'string', ]; public function minLength(int $value): self { return $this->updateSchemaProperty('minLength', $value); } public function maxLength(int $value): self { return $this->updateSchemaProperty('maxLength', $value); } /** * Parameter $pattern is a regular expression without leading/trailing delimiters. * See: https://developer.wordpress.org/rest-api/extending-the-rest-api/schema/#pattern */ public function pattern(string $pattern): self { $this->validatePattern($pattern); return $this->updateSchemaProperty('pattern', $pattern); } public function formatDateTime(): self { return $this->updateSchemaProperty('format', 'date-time'); } public function formatEmail(): self { return $this->updateSchemaProperty('format', 'email'); } public function formatHexColor(): self { return $this->updateSchemaProperty('format', 'hex-color'); } public function formatIp(): self { return $this->updateSchemaProperty('format', 'ip'); } public function formatUri(): self { return $this->updateSchemaProperty('format', 'uri'); } public function formatUuid(): self { return $this->updateSchemaProperty('format', 'uuid'); } }