Fix deprecations and code style issues

This commit is contained in:
2024-03-07 15:26:58 +01:00
parent f0dbb17172
commit 1d636f5e9e
38 changed files with 111 additions and 131 deletions

View File

@@ -39,7 +39,7 @@ readonly class AccompanyingPeriodStepChangeCronjob implements CronJobInterface
return 'accompanying-period-step-change';
}
public function run(array $lastExecutionData): array|null
public function run(array $lastExecutionData): ?array
{
($this->requestor)();

View File

@@ -12,7 +12,6 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Doctrine\DQL;
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
@@ -73,13 +72,13 @@ abstract class AddressPart extends FunctionNode
public function parse(Parser $parser)
{
$a = $parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$a = $parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER);
$parser->match(\Doctrine\ORM\Query\TokenType::T_OPEN_PARENTHESIS);
// person id
$this->pid = $parser->SingleValuedPathExpression();
$parser->match(Lexer::T_COMMA);
$parser->match(\Doctrine\ORM\Query\TokenType::T_COMMA);
// date
$this->date = $parser->ArithmeticPrimary();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
$parser->match(\Doctrine\ORM\Query\TokenType::T_CLOSE_PARENTHESIS);
}
}

View File

@@ -555,7 +555,7 @@ class AccompanyingPeriod implements
// ensure continuity of histories
$criteria = new Criteria();
$criteria->orderBy(['startDate' => Criteria::ASC, 'id' => Criteria::ASC]);
$criteria->orderBy(['startDate' => \Doctrine\Common\Collections\Order::Ascending, 'id' => \Doctrine\Common\Collections\Order::Ascending]);
/** @var \Iterator $locations */
$locations = $this->getLocationHistories()->matching($criteria)->getIterator();
@@ -1536,7 +1536,7 @@ class AccompanyingPeriod implements
{
// ensure continuity of histories
$criteria = new Criteria();
$criteria->orderBy(['startDate' => Criteria::ASC, 'id' => Criteria::ASC]);
$criteria->orderBy(['startDate' => \Doctrine\Common\Collections\Order::Ascending, 'id' => \Doctrine\Common\Collections\Order::Ascending]);
/** @var \Iterator $steps */
$steps = $this->getStepHistories()->matching($criteria)->getIterator();

View File

@@ -1205,7 +1205,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
->where(
$expr->eq('shareHousehold', false)
)
->orderBy(['startDate' => Criteria::DESC]);
->orderBy(['startDate' => \Doctrine\Common\Collections\Order::Descending]);
return $this->getHouseholdParticipations()
->matching($criteria);
@@ -1227,7 +1227,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
->where(
$expr->eq('shareHousehold', true)
)
->orderBy(['startDate' => Criteria::DESC, 'id' => Criteria::DESC]);
->orderBy(['startDate' => \Doctrine\Common\Collections\Order::Descending, 'id' => \Doctrine\Common\Collections\Order::Descending]);
return $this->getHouseholdParticipations()
->matching($criteria);

View File

@@ -48,7 +48,7 @@ final readonly class ClosingDateAggregator implements AggregatorInterface
public function getLabels($key, array $values, mixed $data)
{
return function (string|null $value): string {
return function (?string $value): string {
if ('_header' === $value) {
return 'export.aggregator.course.by_closing_date.header';
}

View File

@@ -48,7 +48,7 @@ final readonly class OpeningDateAggregator implements AggregatorInterface
public function getLabels($key, array $values, mixed $data)
{
return function (string|null $value): string {
return function (?string $value): string {
if ('_header' === $value) {
return 'export.aggregator.course.by_opening_date.header';
}

View File

@@ -521,7 +521,7 @@ class AccompanyingPeriodACLAwareRepositoryTest extends KernelTestCase
/**
* @param array<Scope> $scopes
*/
private function buildPeriod(Person $person, array $scopes, User|null $creator, bool $confirm): AccompanyingPeriod
private function buildPeriod(Person $person, array $scopes, ?User $creator, bool $confirm): AccompanyingPeriod
{
$period = new AccompanyingPeriod();
$period->addPerson($person);