Release 2.2.0 (#4359)

* deactivate deprecation logging in prod for now
* fix several deprecations
* enable CSRF for logout
* allow more twig methods and functions in InvoiceSecurity policy
This commit is contained in:
Kevin Papst
2023-10-31 16:41:09 +01:00
committed by GitHub
parent 114617a052
commit 95f15e6c88
22 changed files with 396 additions and 324 deletions

View File

@@ -9,15 +9,15 @@
namespace App\Model;
use DateTimeInterface;
use DateTimeImmutable;
class Day
{
public function __construct(private DateTimeInterface $day)
public function __construct(private DateTimeImmutable $day)
{
}
public function getDay(): DateTimeInterface
public function getDay(): DateTimeImmutable
{
return $this->day;
}

View File

@@ -20,7 +20,7 @@ class Month
public function __construct(private \DateTimeInterface $month)
{
$date = new \DateTimeImmutable($this->month->format('Y-m-01 00:00:00'));
$date = new \DateTimeImmutable($this->month->format('Y-m-01 00:00:00'), $month->getTimezone());
$start = $date->format('m');
while ($start === $date->format('m')) {
$day = $this->createDay($date);
@@ -29,7 +29,7 @@ class Month
}
}
protected function createDay(\DateTimeInterface $day): Day
protected function createDay(\DateTimeImmutable $day): Day
{
return new Day($day);
}

View File

@@ -20,17 +20,15 @@ class Year
public function __construct(private DateTimeInterface $month)
{
$monthDate = new \DateTimeImmutable();
$monthDate = $monthDate->setDate((int) $this->month->format('Y'), 1, 1);
$monthDate = $monthDate->setTime(1, 0);
$monthDate = new \DateTimeImmutable($this->month->format('Y-01-01 01:00:00'), $this->month->getTimezone());
for ($i = 1; $i < 13; $i++) {
$month = $this->createMonth($monthDate);
$this->setMonth($month);
$tmp = $this->createMonth($monthDate);
$this->setMonth($tmp);
$monthDate = $monthDate->add(new \DateInterval('P1M'));
}
}
protected function createMonth(\DateTimeInterface $month): Month
protected function createMonth(\DateTimeImmutable $month): Month
{
return new Month($month);
}