Fix implicit variable creation.

This commit is contained in:
Pol Dellaiera
2021-11-09 15:25:45 +01:00
parent a1b381a3ea
commit 5e5dcaefe7
21 changed files with 464 additions and 581 deletions

View File

@@ -38,18 +38,18 @@ use Chill\MainBundle\Timeline\TimelineSingleQuery;
class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface
{
protected EntityManagerInterface $em;
protected Registry $registry;
protected AuthorizationHelper $authorizationHelper;
protected Security $security;
const TYPE = 'chill_task.transition';
public function __construct(
EntityManagerInterface $em,
EntityManagerInterface $em,
Registry $registry,
AuthorizationHelper $authorizationHelper,
Security $security
@@ -64,7 +64,7 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface
{
$metadata = $this->em
->getClassMetadata(SingleTaskPlaceEvent::class);
switch ($context) {
case 'person':
[ $where, $parameters ] = $this->getWhereClauseForPerson($args['person']);
@@ -157,7 +157,7 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface
// the parameters
$parameters = [];
$parameters = $circleIds = [];
// the clause that we will fill
$clause = "{person}.{person_id} = ? AND {task}.{circle} IN ({circle_ids})";
@@ -212,27 +212,27 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface
'{single_task}' => sprintf('%s.%s', $singleTask->getSchemaName(), $singleTask->getTableName()),
'{single_task_event}' => sprintf('%s.%s', $taskEvent->getSchemaName(), $taskEvent->getTableName()),
'{task_pk}' => $singleTask->getColumnName('id'),
'{event_fk_task}' => $eventFkTask,
'{event_fk_task}' => $eventFkTask,
'{person}' => $person->getTableName(),
'{task_person_fk}' => $taskFkPerson,
'{person_pk}' => $personPk
'{person_pk}' => $personPk
]
);
}
public function getEntities(array $ids)
}
public function getEntities(array $ids)
{
$events = $this->em
->getRepository(SingleTaskPlaceEvent::class)
->findBy([ 'id' => $ids ])
;
return \array_combine(
\array_map(function($e) { return $e->getId(); }, $events ),
$events
);
}
}
public function getEntityTemplate($entity, $context, array $args)
{
$workflow = $this->registry->get($entity->getTask(),
@@ -242,22 +242,22 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface
// `Notice: Undefined property: Chill\TaskBundle\Entity\Task\SingleTaskPlaceEvent::$getData`
// * fix syntax error on $entity->getData['workflow']
// * return null if not set
$transition = $this->getTransitionByName($entity->getTransition(), $workflow);
return [
'template' => 'ChillTaskBundle:Timeline:single_task_transition.html.twig',
'template_data' => [
'template_data' => [
'context' => $context,
'event' => $entity,
'task' => $entity->getTask(),
'transition' => $transition
]
];
}
}
/**
*
*
* @param string $name
* @param Workflow $workflow
* @return \Symfony\Component\Workflow\Transition
@@ -270,7 +270,7 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface
}
}
}
public function supportsType($type): bool
{
return $type === self::TYPE;