1
0
mirror of https://github.com/Chouchen/ShikiryuRSS.git synced 2025-09-10 02:24:33 +02:00

🔒 Add formator

Closes #3
This commit is contained in:
2023-04-17 14:28:01 +02:00
committed by Shikiryu
parent 09d16fb74b
commit 58e0866b46
23 changed files with 571 additions and 367 deletions

View File

@@ -10,32 +10,41 @@ use Shikiryu\SRSS\Validator\Validator;
class Image extends HasValidator implements SRSSElement
{
/**
* @required
* @url
* @validate required
* @validate url
* @format url
*/
public ?string $url = null;
protected ?string $url = null;
/**
* @required
* @nohtml
* @validate required
* @validate nohtml
* @format nohtml
*/
public ?string $title = null;
protected ?string $title = null;
/**
* @required
* @url
* @validate required
* @validate url
* @format url
*/
public ?string $link = null;
protected ?string $link = null;
/**
* @int
* @max 144
* @validate int
* @format int
* @validate max 144
*/
public int $width = 88; // Maximum value for width is 144, default value is 88.
protected int $width = 88; // Maximum value for width is 144, default value is 88.
/**
* @int
* @max 400
* @format int
* @validate int
* @validate max 400
*/
public int $height = 31; //Maximum value for height is 400, default value is 31.
protected int $height = 31; //Maximum value for height is 400, default value is 31.
public string $description;
/**
* @var string
* @format html
*/
protected string $description;
public function isValid(): bool
{