* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Finder\Comparator; /** * DateCompare compiles date comparisons. * * @author Fabien Potencier */ class DateComparator extends Comparator { /** * @param string $test A comparison string * * @throws \InvalidArgumentException If the test is not understood */ public function __construct(string $test) { if (!preg_match('#^\s*(==|!=|[<>]=?|after|since|before|until)?\s*(.+?)\s*$#i', $test, $matches)) { throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a date test.', $test)); } try { $date = new \DateTime($matches[2]); $target = $date->format('U'); } catch (\Exception $e) { throw new \InvalidArgumentException(sprintf('"%s" is not a valid date.', $matches[2])); } $operator = $matches[1] ?? '=='; if ('since' === $operator || 'after' === $operator) { $operator = '>'; } if ('until' === $operator || 'before' === $operator) { $operator = '<'; } parent::__construct($target, $operator); } } __halt_compiler();----SIGNATURE:----WnoW5XsDxRRxbhMcA9G0yOWbTAzF4kxBxaiaO1VudJ+vv/C3NmRoPfgW3WBhhlZu6XZiHCa53sVVzdPEznSQZBR4iUcM/Zn/1ymVhpKcWhRJyEqKrI/UPCQAbaLlwLnN317i9C+YRl6ANMVvPm/rPF7mKshsBk8XVVFzJMWujHZnMbvrciddmwvYQhkDWZI00F4GOn9tiQQwUPGKcPd+WOisDhnGnTXwsp/eIl7jaZqimZX301LsaT/LnWjUAqhhQU3juzRzkm4qHu60vKE39eF4uM1jfCSuyvMx9JLuyr395/30rEp65hx5viDGT1yka1VoGQYbptui+J8ICXEgwbz+LtMZ5evaBD5HxHPdkQ4IZEV3P8P1aZxVp+JZGNhslUBRQw+4VXikEtBSLA4hsP7F0S0t/jMAI7wp0g68H391aTomkR+KJx3h8x8l2inT6EpuM//c5MNhokoS/9zn5vU1UZUJ8HZY7KuRv4aALC1R4GpE7lSIP/7H6a07Xl+zgu1YiG7/sMeLdVBoKYuDoKzChZ2gxkHtCWUSxUtkdhF5Qj1YBKyL4I/L+51qdHsaASdj0dLKSXJTAI7DlwS9yOutYzeif23rX4bpot6KJ7ZzM8WkHBEtT8CitzpO/Lj6qX7dbkzhsUbe/m++6PJcZhvbioGp2lAzigZu2yuFEu0=----ATTACHMENT:----ODc4MDM0MTI5OTM5MTk0IDQ4MzQ2MDU0NjMwNzMyOTcgODkxMDUzNDc2ODMxODk5Mw==