mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-01 20:43:49 +00:00
Php cs fixes
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Service\Workflow;
|
||||
|
||||
use Chill\MainBundle\Repository\Workflow\EntityWorkflowRepository;
|
||||
@@ -12,9 +21,7 @@ use Symfony\Component\Workflow\Registry;
|
||||
#[AsMessageHandler]
|
||||
class CancelStaleWorkflowHandler
|
||||
{
|
||||
public function __construct(private readonly EntityWorkflowRepository $workflowRepository, private readonly Registry $registry, private EntityManagerInterface $em, private LoggerInterface $logger)
|
||||
{
|
||||
}
|
||||
public function __construct(private readonly EntityWorkflowRepository $workflowRepository, private readonly Registry $registry, private EntityManagerInterface $em, private LoggerInterface $logger) {}
|
||||
|
||||
public function __invoke(CancelStaleWorkflow $message): void
|
||||
{
|
||||
@@ -28,7 +35,7 @@ class CancelStaleWorkflowHandler
|
||||
|
||||
$transitionApplied = false;
|
||||
|
||||
if (count($steps) === 1) {
|
||||
if (1 === count($steps)) {
|
||||
$this->em->remove($workflow->getCurrentStep());
|
||||
$this->em->remove($workflow);
|
||||
} else {
|
||||
@@ -46,12 +53,8 @@ class CancelStaleWorkflowHandler
|
||||
|
||||
if (!$transitionApplied) {
|
||||
$this->logger->error(sprintf('No valid transition found for EntityWorkflow %d.', $workflowId));
|
||||
throw new UnrecoverableMessageHandlingException(
|
||||
sprintf('No valid transition found for EntityWorkflow %d.', $workflowId)
|
||||
);
|
||||
throw new UnrecoverableMessageHandlingException(sprintf('No valid transition found for EntityWorkflow %d.', $workflowId));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user