Use WorkflowInterface instead of Workflow

This commit is contained in:
2025-08-27 16:01:01 +02:00
parent f91ab63b3a
commit da240f5ce5
2 changed files with 4 additions and 14 deletions

View File

@@ -17,7 +17,7 @@ use Chill\TaskBundle\Entity\SingleTask;
use Chill\TaskBundle\Entity\Task\SingleTaskPlaceEvent;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Workflow\Registry;
use Symfony\Component\Workflow\Workflow;
use Symfony\Component\Workflow\WorkflowInterface;
/**
* Provide timeline elements related to tasks, in tasks context.
@@ -108,12 +108,7 @@ class SingleTaskTaskLifeCycleEventTimelineProvider implements TimelineProviderIn
return self::TYPE === $type;
}
/**
* @param string $name
*
* @return \Symfony\Component\Workflow\Transition
*/
protected function getTransitionByName($name, Workflow $workflow)
protected function getTransitionByName(string $name, WorkflowInterface $workflow)
{
foreach ($workflow->getDefinition()->getTransitions() as $transition) {
if ($transition->getName() === $name) {

View File

@@ -21,7 +21,7 @@ use Chill\TaskBundle\Entity\Task\SingleTaskPlaceEvent;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\Workflow\Registry;
use Symfony\Component\Workflow\Workflow;
use Symfony\Component\Workflow\WorkflowInterface;
/**
* Provide element for timeline for 'person' and 'center' context.
@@ -94,12 +94,7 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface
return self::TYPE === $type;
}
/**
* @param string $name
*
* @return \Symfony\Component\Workflow\Transition
*/
protected function getTransitionByName($name, Workflow $workflow)
protected function getTransitionByName(string $name, WorkflowInterface $workflow)
{
foreach ($workflow->getDefinition()->getTransitions() as $transition) {
if ($transition->getName() === $name) {