* * 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:----sQczhCSlWvHVmhY/29iNVMqULJu0BhJKe/GXiMkhfH0fbQOwc9PnylNb0MCfP1fPxQV2tVIzFBn33SxfU06k+jvDRA50tYJDG6czac/tDLM+e6DFbquI2ZfM+Qjb5RoJA2U0Qai5kMe50f1YAo6ssE36vy9J1GY2/y4B1/AT8fc4jMDdz3MYY4xs5utsYCavN0YWmAHOyC/74CriT2mhYVDc5pxODiAaB+ytV75y96TY6r9uTQWyadSXTOedNqh7zfYiQVmt+s/3xykTS/iadS65pImRvghbg3KOTm9GwVTnzp4FU9Iieo6VmjooTPxIe5XTHsAdWqGE3ziMJBDWD7fmTKuDd3YfNHp4bcCxK6WBhcNumEdFSkFP7+wuBYdKSExxwjRkAmXBEDuMDS93jzcd+dttiIVx4XOPkrRoJo2XG7B3UHJDRP23Vks1u7EnbYoAqDadVzyc7tT6o0wke2zFeRnN3aXc14PiKOuFCKKMa+FQ3LNoiLd6h7FPI4Bc/V6wWowBdsx+IFQFkB4Csl+1wmAun+gERtlzIUEdiKay3Xgs2/kShYwxcc37DwLvH+hPBMtuiaPZtzNUaA4baw4gwr0sOdLdFdxM37qwpcK/z6qA9IfQ2cDbP+5hMTkRpJ9prXuIdatI+ZX+zhpN2g0JAQAR5ngnPuwEnv06/ko=----ATTACHMENT:----ODY3NDUzMTg3OTUxNzY1OSAzNzU5MjA0MjgwNTk0OTE3IDc5NzgzMDM5NTA2MTQ3OTE=