mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-04 22:04:59 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -35,7 +35,6 @@ use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
use Symfony\Component\Workflow\Registry;
|
||||
use Symfony\Component\Workflow\TransitionBlocker;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use function count;
|
||||
|
||||
class WorkflowController extends AbstractController
|
||||
{
|
||||
@@ -67,11 +66,11 @@ class WorkflowController extends AbstractController
|
||||
|
||||
$errors = $this->validator->validate($entityWorkflow, null, ['creation']);
|
||||
|
||||
if (count($errors) > 0) {
|
||||
if (\count($errors) > 0) {
|
||||
$msg = [];
|
||||
|
||||
foreach ($errors as $error) {
|
||||
/** @var \Symfony\Component\Validator\ConstraintViolationInterface $error */
|
||||
/* @var \Symfony\Component\Validator\ConstraintViolationInterface $error */
|
||||
$msg[] = $error->getMessage();
|
||||
}
|
||||
|
||||
@@ -294,7 +293,7 @@ class WorkflowController extends AbstractController
|
||||
$workflow = $this->registry->get($entityWorkflow, $entityWorkflow->getWorkflowName());
|
||||
$errors = [];
|
||||
|
||||
if (count($workflow->getEnabledTransitions($entityWorkflow)) > 0) {
|
||||
if (\count($workflow->getEnabledTransitions($entityWorkflow)) > 0) {
|
||||
// possible transition
|
||||
|
||||
$usersInvolved = $entityWorkflow->getUsersInvolved();
|
||||
@@ -310,7 +309,7 @@ class WorkflowController extends AbstractController
|
||||
[
|
||||
'transition' => true,
|
||||
'entity_workflow' => $entityWorkflow,
|
||||
'suggested_users' => $usersInvolved
|
||||
'suggested_users' => $usersInvolved,
|
||||
]
|
||||
);
|
||||
|
||||
@@ -324,12 +323,7 @@ class WorkflowController extends AbstractController
|
||||
$tb->getParameters()
|
||||
), iterator_to_array($blockers));
|
||||
|
||||
throw $this->createAccessDeniedException(
|
||||
sprintf(
|
||||
"not allowed to apply transition {$transition}: %s",
|
||||
implode(', ', $msgs)
|
||||
)
|
||||
);
|
||||
throw $this->createAccessDeniedException(sprintf("not allowed to apply transition {$transition}: %s", implode(', ', $msgs)));
|
||||
}
|
||||
|
||||
// TODO symfony 5: add those "future" on context ($workflow->apply($entityWorkflow, $transition, $context)
|
||||
@@ -374,7 +368,7 @@ class WorkflowController extends AbstractController
|
||||
'transition_form' => isset($transitionForm) ? $transitionForm->createView() : null,
|
||||
'entity_workflow' => $entityWorkflow,
|
||||
'transition_form_errors' => $errors,
|
||||
//'comment_form' => $commentForm->createView(),
|
||||
// 'comment_form' => $commentForm->createView(),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user