Release 2.9.0 (#4526)
* added fix to work around bc break in new phpword version * fix phpoffice deprecations * mark unused option as deprecated * support for DateTimeInterface and DateTimeImmutable where possible * use TRUSTED_PROXIES setting - fixes #4533 * re-enable Kimai test in docker test build script (#4541) * bump dependencies
This commit is contained in:
30
src/Repository/Query/DateRangeInterface.php
Normal file
30
src/Repository/Query/DateRangeInterface.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Repository\Query;
|
||||
|
||||
use App\Form\Model\DateRange;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
interface DateRangeInterface
|
||||
{
|
||||
public function getBegin(): ?\DateTime;
|
||||
|
||||
public function setBegin(\DateTimeInterface $begin): void;
|
||||
|
||||
public function getEnd(): ?\DateTime;
|
||||
|
||||
public function setEnd(\DateTimeInterface $end): void;
|
||||
|
||||
public function getDateRange(): ?DateRange;
|
||||
|
||||
public function setDateRange(DateRange $dateRange): void;
|
||||
}
|
||||
@@ -20,9 +20,9 @@ trait DateRangeTrait
|
||||
return $this->dateRange?->getBegin();
|
||||
}
|
||||
|
||||
public function setBegin(\DateTime $begin): void
|
||||
public function setBegin(\DateTimeInterface $begin): void
|
||||
{
|
||||
$this->dateRange->setBegin($begin);
|
||||
$this->dateRange->setBegin(\DateTime::createFromInterface($begin));
|
||||
}
|
||||
|
||||
public function getEnd(): ?\DateTime
|
||||
@@ -30,9 +30,9 @@ trait DateRangeTrait
|
||||
return $this->dateRange?->getEnd();
|
||||
}
|
||||
|
||||
public function setEnd(\DateTime $end): void
|
||||
public function setEnd(\DateTimeInterface $end): void
|
||||
{
|
||||
$this->dateRange->setEnd($end);
|
||||
$this->dateRange->setEnd(\DateTime::createFromInterface($end));
|
||||
}
|
||||
|
||||
public function getDateRange(): ?DateRange
|
||||
|
||||
@@ -16,7 +16,7 @@ use App\Form\Model\DateRange;
|
||||
/**
|
||||
* Query for created invoices.
|
||||
*/
|
||||
class InvoiceArchiveQuery extends BaseQuery
|
||||
class InvoiceArchiveQuery extends BaseQuery implements DateRangeInterface
|
||||
{
|
||||
use DateRangeTrait;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ use App\Entity\Tag;
|
||||
use App\Entity\User;
|
||||
use App\Form\Model\DateRange;
|
||||
|
||||
class TimesheetQuery extends ActivityQuery implements BillableInterface
|
||||
class TimesheetQuery extends ActivityQuery implements BillableInterface, DateRangeInterface
|
||||
{
|
||||
use BillableTrait;
|
||||
use DateRangeTrait;
|
||||
|
||||
Reference in New Issue
Block a user