for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Mbright\Validation\Rule\Validate;
use Mbright\Validation\Rule\AbstractDateTime;
class DateTime extends AbstractDateTime implements ValidateRuleInterface
{
/**
* Validate that a value can be represented as a date/time.
*
* @param object $subject The subject to be filtered.
* @param string $field The subject field name.
* @return bool
*/
public function __invoke($subject, string $field): bool
$value = $subject->$field;
$datetime = $this->newDateTime($value);
return (bool) $datetime;
}