mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix phpcs, psalm and phpstan
This commit is contained in:
parent
64fa7f2e00
commit
e3c5f6f95f
@ -927,15 +927,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php
|
||||
|
||||
-
|
||||
message:
|
||||
"""
|
||||
#^Parameter \\$trans of method Chill\\\\PersonBundle\\\\Controller\\\\AccompanyingCourseWorkController\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
|
||||
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
|
||||
"""
|
||||
count: 1
|
||||
path: src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php
|
||||
|
||||
-
|
||||
message:
|
||||
"""
|
||||
|
@ -167,6 +167,7 @@ class WorkflowController extends AbstractController
|
||||
|
||||
$handler = $this->entityWorkflowManager->getHandler($entityWorkflow);
|
||||
$workflow = $this->registry->get($entityWorkflow, $entityWorkflow->getWorkflowName());
|
||||
$errors = [];
|
||||
|
||||
if (count($workflow->getEnabledTransitions($entityWorkflow)) > 0) {
|
||||
// possible transition
|
||||
@ -245,7 +246,7 @@ class WorkflowController extends AbstractController
|
||||
'handler_template_data' => $handler->getTemplateData($entityWorkflow),
|
||||
'transition_form' => isset($transitionForm) ? $transitionForm->createView() : null,
|
||||
'entity_workflow' => $entityWorkflow,
|
||||
'transition_form_errors' => $errors ?? [],
|
||||
'transition_form_errors' => $errors,
|
||||
//'comment_form' => $commentForm->createView(),
|
||||
]
|
||||
);
|
||||
|
@ -56,7 +56,7 @@ class EntityWorkflowStepRepository implements ObjectRepository
|
||||
|
||||
public function getClassName()
|
||||
{
|
||||
return EntityWorkflow::class;
|
||||
return EntityWorkflowStep::class;
|
||||
}
|
||||
|
||||
private function buildQueryByUser(User $user): QueryBuilder
|
||||
|
@ -32,20 +32,20 @@ final class WorkflowByUserCounter implements NotificationCounterInterface, Event
|
||||
$this->cacheItemPool = $cacheItemPool;
|
||||
}
|
||||
|
||||
public function addNotification(UserInterface $user): int
|
||||
public function addNotification(UserInterface $u): int
|
||||
{
|
||||
if (!$user instanceof User) {
|
||||
if (!$u instanceof User) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$key = self::generateCacheKeyWorkflowByUser($user);
|
||||
$key = self::generateCacheKeyWorkflowByUser($u);
|
||||
$item = $this->cacheItemPool->getItem($key);
|
||||
|
||||
if ($item->isHit()) {
|
||||
return $item->get();
|
||||
}
|
||||
|
||||
$nb = $this->getCountUnreadByUser($user);
|
||||
$nb = $this->getCountUnreadByUser($u);
|
||||
|
||||
$item->set($nb)
|
||||
->expiresAfter(60 * 15);
|
||||
|
@ -72,9 +72,6 @@ class MetadataExtractor
|
||||
|
||||
foreach ($transitions as $transition) {
|
||||
if ($transition->getName() === $transitionName) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
$metadata = $workflow->getMetadataStore()->getTransitionMetadata($transition);
|
||||
|
||||
return [
|
||||
@ -84,6 +81,10 @@ class MetadataExtractor
|
||||
'isForward' => $metadata['isForward'] ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function buildArrayPresentationForWorkflow(WorkflowInterface $workflow): array
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user