8000 [Finder] Fix using `==` as default operator in `DateComparator` · symfony/symfony@a247d58 · GitHub
[go: up one dir, main page]

Skip to content
< 8000 div style="--sticky-pane-height:100vh;--spacing:var(--spacing-none)" class="Box-sc-g0xbh4-0 prc-PageLayout-PageLayoutRoot-1zlEO">

Commit a247d58

Browse files
committed
[Finder] Fix using == as default operator in DateComparator
1 parent 322e13c commit a247d58

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Symfony/Component/Finder/Comparator/DateComparator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(string $test)
3636
throw new \InvalidArgumentException(sprintf('"%s" is not a valid date.', $matches[2]));
3737
}
3838

39-
$operator = $matches[1] ?? '==';
39+
$operator = $matches[1] ?: '==';
4040
if ('since' === $operator || 'after' === $operator) {
4141
$operator = '>';
4242
}

src/Symfony/Component/Finder/Tests/Comparator/DateComparatorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public static function getTestData()
5959
['after 2005-10-10', [strtotime('2005-10-15')], [strtotime('2005-10-09')]],
6060
['since 2005-10-10', [strtotime('2005-10-15')], [strtotime('2005-10-09')]],
6161
['!= 2005-10-10', [strtotime('2005-10-11')], [strtotime('2005-10-10')]],
62+
['2005-10-10', [strtotime('2005-10-10')], [strtotime('2005-10-11')]],
6263
];
6364
}
6465
}

0 commit comments

Comments
 (0)
0