🚧 Add some validations and corrections

This commit is contained in:
Shikiryu committed 2023-04-11 23:49:03 +02:00
1 parent 5de5993e2b
commit f1816dec0c
10 files changed
+48 -26

No files matched your search

+5 -2
View File
@@ -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