12 namespace Symfony\Component\Finder\Comparator;
30 if (!preg_match(
'#^\s*(==|!=|[<>]=?|after|since|before|until)?\s*(.+?)\s*$#i', $test, $matches)) {
31 throw new \InvalidArgumentException(sprintf(
'Don\'t understand "%s" as a date test.', $test));
35 $date = new \DateTime($matches[2]);
37 }
catch (\Exception $e) {
38 throw new \InvalidArgumentException(sprintf(
'"%s" is not a valid date.', $matches[2]));
41 $operator = isset($matches[1]) ? $matches[1] :
'==';
42 if (
'since' === $operator ||
'after' === $operator) {
46 if (
'until' === $operator ||
'before' === $operator) {