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:
Kevin Papst
2024-01-10 12:43:07 +01:00
committed by GitHub
parent c6a651456e
commit 6531e7fe52
46 changed files with 487 additions and 485 deletions

View File

@@ -13,13 +13,27 @@ use App\Model\ActivityBudgetStatisticModel;
final class ActivityBudgetStatisticEvent
{
private readonly ?\DateTime $begin;
private readonly ?\DateTime $end;
/**
* @param ActivityBudgetStatisticModel[] $models
* @param \DateTime|null $begin
* @param \DateTime|null $end
*/
public function __construct(private array $models, private ?\DateTime $begin = null, private ?\DateTime $end = null)
public function __construct(
private readonly array $models,
?\DateTimeInterface $begin = null,
?\DateTimeInterface $end = null
)
{
if ($begin !== null) {
$begin = \DateTime::createFromInterface($begin);
}
$this->begin = $begin;
if ($end !== null) {
$end = \DateTime::createFromInterface($end);
}
$this->end = $end;
}
public function getModel(int $activityId): ?ActivityBudgetStatisticModel

View File

@@ -11,12 +11,32 @@ namespace App\Event;
use App\Entity\Activity;
use App\Model\ActivityStatistic;
use DateTime;
use DateTimeInterface;
final class ActivityStatisticEvent extends AbstractActivityEvent
{
public function __construct(Activity $activity, private ActivityStatistic $statistic, private ?\DateTime $begin = null, private ?\DateTime $end = null)
private readonly ?DateTime $begin;
private readonly ?DateTime $end;
public function __construct(
Activity $activity,
private readonly ActivityStatistic $statistic,
?DateTimeInterface $begin = null,
?DateTimeInterface $end = null
)
{
parent::__construct($activity);
if ($begin !== null) {
$begin = DateTime::createFromInterface($begin);
}
$this->begin = $begin;
if ($end !== null) {
$end = DateTime::createFromInterface($end);
}
$this->end = $end;
}
public function getStatistic(): ActivityStatistic
@@ -24,12 +44,12 @@ final class ActivityStatisticEvent extends AbstractActivityEvent
return $this->statistic;
}
public function getBegin(): ?\DateTime
public function getBegin(): ?DateTime
{
return $this->begin;
}
public function getEnd(): ?\DateTime
public function getEnd(): ?DateTime
{
return $this->end;
}

View File

@@ -10,16 +10,32 @@
namespace App\Event;
use App\Model\ProjectBudgetStatisticModel;
use DateTime;
use DateTimeInterface;
final class ProjectBudgetStatisticEvent
{
private readonly ?DateTime $begin;
private readonly ?DateTime $end;
/**
* @param ProjectBudgetStatisticModel[] $models
* @param \DateTime|null $begin
* @param \DateTime|null $end
*/
public function __construct(private array $models, private ?\DateTime $begin = null, private ?\DateTime $end = null)
public function __construct(
private readonly array $models,
?DateTimeInterface $begin = null,
?DateTimeInterface $end = null
)
{
if ($begin !== null) {
$begin = \DateTime::createFromInterface($begin);
}
$this->begin = $begin;
if ($end !== null) {
$end = \DateTime::createFromInterface($end);
}
$this->end = $end;
}
public function getModel(int $projectId): ?ProjectBudgetStatisticModel
@@ -45,12 +61,12 @@ final class ProjectBudgetStatisticEvent
return $this->models;
}
public function getBegin(): ?\DateTime
public function getBegin(): ?DateTime
{
return $this->begin;
}
public function getEnd(): ?\DateTime
public function getEnd(): ?DateTime
{
return $this->end;
}

View File

@@ -14,7 +14,12 @@ use App\Model\ProjectStatistic;
final class ProjectStatisticEvent extends AbstractProjectEvent
{
public function __construct(Project $project, private ProjectStatistic $statistic, private ?\DateTime $begin = null, private ?\DateTime $end = null)
public function __construct(
Project $project,
private readonly ProjectStatistic $statistic,
private readonly ?\DateTimeInterface $begin = null,
private readonly ?\DateTimeInterface $end = null
)
{
parent::__construct($project);
}
@@ -24,12 +29,12 @@ final class ProjectStatisticEvent extends AbstractProjectEvent
return $this->statistic;
}
public function getBegin(): ?\DateTime
public function getBegin(): ?\DateTimeInterface
{
return $this->begin;
}
public function getEnd(): ?\DateTime
public function getEnd(): ?\DateTimeInterface
{
return $this->end;
}