mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 23:53:50 +00:00
fix phpcs, psalm and phpstan
This commit is contained in:
@@ -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,17 +72,18 @@ class MetadataExtractor
|
||||
|
||||
foreach ($transitions as $transition) {
|
||||
if ($transition->getName() === $transitionName) {
|
||||
break;
|
||||
$metadata = $workflow->getMetadataStore()->getTransitionMetadata($transition);
|
||||
|
||||
return [
|
||||
'name' => $transition->getName(),
|
||||
'text' => array_key_exists('label', $metadata) ?
|
||||
$this->translatableStringHelper->localize($metadata['label']) : $transition->getName(),
|
||||
'isForward' => $metadata['isForward'] ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
$metadata = $workflow->getMetadataStore()->getTransitionMetadata($transition);
|
||||
|
||||
return [
|
||||
'name' => $transition->getName(),
|
||||
'text' => array_key_exists('label', $metadata) ?
|
||||
$this->translatableStringHelper->localize($metadata['label']) : $transition->getName(),
|
||||
'isForward' => $metadata['isForward'] ?? null,
|
||||
];
|
||||
return [];
|
||||
}
|
||||
|
||||
public function buildArrayPresentationForWorkflow(WorkflowInterface $workflow): array
|
||||
|
Reference in New Issue
Block a user