DX: apply rector rules up to php8.0

This commit is contained in:
2023-04-15 01:05:37 +02:00
parent d8870e906f
commit dde3002100
714 changed files with 2348 additions and 9263 deletions

View File

@@ -40,24 +40,8 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface
{
public const TYPE = 'chill_task.transition';
protected AuthorizationHelper $authorizationHelper;
protected EntityManagerInterface $em;
protected Registry $registry;
protected Security $security;
public function __construct(
EntityManagerInterface $em,
Registry $registry,
AuthorizationHelper $authorizationHelper,
Security $security
) {
$this->em = $em;
$this->registry = $registry;
$this->authorizationHelper = $authorizationHelper;
$this->security = $security;
public function __construct(protected EntityManagerInterface $em, protected Registry $registry, protected AuthorizationHelper $authorizationHelper, protected Security $security)
{
}
public function fetchQuery($context, $args)
@@ -65,20 +49,11 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface
$metadata = $this->em
->getClassMetadata(SingleTaskPlaceEvent::class);
switch ($context) {
case 'person':
[ $where, $parameters ] = $this->getWhereClauseForPerson($args['person']);
break;
case 'center':
[ $where, $parameters ] = $this->getWhereClauseForCenter($args['centers']);
break;
default:
throw new UnexpectedValueException("context {$context} is not supported");
}
[ $where, $parameters ] = match ($context) {
'person' => $this->getWhereClauseForPerson($args['person']),
'center' => $this->getWhereClauseForCenter($args['centers']),
default => throw new UnexpectedValueException("context {$context} is not supported"),
};
return TimelineSingleQuery::fromArray([
'id' => sprintf('%s.%s.%s', $metadata->getSchemaName(), $metadata->getTableName(), $metadata->getColumnName('id')),