mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-31 20:13:49 +00:00
DX: apply rector rules up to php8.0
This commit is contained in:
@@ -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')),
|
||||
|
Reference in New Issue
Block a user