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

🚧 Continues tests, parser and starts builder

For #4
This commit is contained in:
2023-04-07 17:57:35 +02:00
parent fec8c122e3
commit 63d0b03b50
18 changed files with 494 additions and 234 deletions

View File

@@ -2,14 +2,47 @@
namespace Shikiryu\SRSS\Entity\Channel;
class Image
use Shikiryu\SRSS\Entity\SRSSElement;
use Shikiryu\SRSS\Validator\HasValidator;
use Shikiryu\SRSS\Validator\Validator;
class Image extends HasValidator implements SRSSElement
{
/**
* @required
* @url
*/
public string $url;
/**
* @required
* @nohtml
*/
public string $title;
/**
* @required
* @url
*/
public string $link;
public int $width; // Maximum value for width is 144, default value is 88.
public int $height; //Maximum value for height is 400, default value is 31.
/**
* @int
* @max 144
*/
public int $width = 88; // Maximum value for width is 144, default value is 88.
/**
* @int
* @max 400
*/
public int $height = 31; //Maximum value for height is 400, default value is 31.
public string $description;
public array $required = ['url', 'title', 'link'];
public function isValid(): bool
{
return (new Validator())->isObjectValid($this);
}
public function toArray(): array
{
return get_object_vars($this);
}
}