mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Added nullsafe operator to simplify conditions
This commit is contained in:
@@ -20,11 +20,11 @@ class InDateRange extends BaseSpecification
|
||||
{
|
||||
$criteria = [];
|
||||
|
||||
if ($this->dateRange !== null && $this->dateRange->getStartDate() !== null) {
|
||||
if ($this->dateRange?->getStartDate() !== null) {
|
||||
$criteria[] = Spec::gte($this->field, $this->dateRange->getStartDate()->toDateTimeString());
|
||||
}
|
||||
|
||||
if ($this->dateRange !== null && $this->dateRange->getEndDate() !== null) {
|
||||
if ($this->dateRange?->getEndDate() !== null) {
|
||||
$criteria[] = Spec::lte($this->field, $this->dateRange->getEndDate()->toDateTimeString());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user