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

🔒 Remove dead code and another way to validate data

This commit is contained in:
Shikiryu
2023-04-13 01:10:52 +02:00
parent 3419e7d46c
commit a6a31e18e1
5 changed files with 68 additions and 135 deletions

View File

@@ -15,6 +15,7 @@ use Shikiryu\SRSS\Exception\PropertyNotFoundException;
use Shikiryu\SRSS\Exception\SRSSException;
use Shikiryu\SRSS\Exception\UnreadableRSSException;
use Shikiryu\SRSS\Parser\SRSSParser;
use Shikiryu\SRSS\Validator\Validator;
/**
* @property null|string $title
@@ -124,10 +125,9 @@ class SRSS implements Iterator
if (!property_exists(Channel::class, $name)) {
throw new PropertyNotFoundException(Channel::class, $name);
}
// TODO add validator ?
// if ((new Validator())->isPropertyValid($this->channel, $name)) {
if ((new Validator())->isValidValueForObjectProperty($this->channel, $name, $val)) {
$this->channel->{$name} = $val;
// }
}
}
/**