mirror of
https://github.com/Chouchen/ShikiryuRSS.git
synced 2026-11-25 01:01:18 +01:00
🚧 Add some validations and corrections
This commit is contained in:
1 parent
5de5993e2b
commit
f1816dec0c
10 files changed
+48
-26
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Shikiryu\SRSS\Validator;
|
||||
|
||||
use DateTime;
|
||||
use DateTimeInterface;
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
@@ -12,7 +13,7 @@ class Validator
|
||||
{
|
||||
protected ?object $object = null;
|
||||
/**
|
||||
* @throws \ReflectionException
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public function isPropertyValid($object, $property)
|
||||
{
|
||||
@@ -34,6 +35,8 @@ class Validator
|
||||
|
||||
$object->validated[$properties->name] = $this->_validateProperty($annotation, $propertyValue);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -173,7 +176,7 @@ class Validator
|
||||
|
||||
private function _validateDate($value): bool
|
||||
{
|
||||
return \DateTime::createFromFormat(DateTimeInterface::RSS, $value) !== false;
|
||||
return DateTime::createFromFormat(DateTimeInterface::RSS, $value) !== false;
|
||||
}
|
||||
|
||||
private function _validateHour($value): bool
|
||||
|
||||
Reference in new issue
Block a user