1
0
mirror of https://github.com/Chouchen/ShikiryuRSS.git synced 2024-05-20 06:31:30 +02:00
ShikiryuRSS/src/SRSSTools.php

29 lines
539 B
PHP
Raw Normal View History

<?php
namespace Shikiryu\SRSS;
2023-04-13 11:24:43 +02:00
use ReflectionProperty;
2023-04-17 14:28:01 +02:00
use Shikiryu\SRSS\Validator\Formator;
class SRSSTools
{
2023-04-17 14:28:01 +02:00
/**
* @throws \ReflectionException
*/
2023-04-13 11:24:43 +02:00
public static function getPropertyType($object, $property): ?string
{
$rp = new ReflectionProperty($object, $property);
return $rp->getType()?->getName();
}
/**
2023-04-17 14:28:01 +02:00
* @param string $string
2023-04-12 15:28:38 +02:00
*
* @return string
*/
2023-04-17 14:28:01 +02:00
public static function getRSSDate(string $string)
{
2023-04-17 14:28:01 +02:00
return Formator::checkDate($string);
}
2023-04-17 14:28:01 +02:00
}