mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -16,7 +16,6 @@ use Chill\MainBundle\Entity\Workflow\EntityWorkflowStep;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||
use Symfony\Component\Workflow\Registry;
|
||||
use Symfony\Component\Workflow\WorkflowInterface;
|
||||
use function array_key_exists;
|
||||
|
||||
class MetadataExtractor
|
||||
{
|
||||
@@ -35,7 +34,7 @@ class MetadataExtractor
|
||||
|
||||
foreach ($workflows as $workflow) {
|
||||
$metadata = $workflow->getMetadataStore()->getWorkflowMetadata();
|
||||
$text = array_key_exists('label', $metadata) ?
|
||||
$text = \array_key_exists('label', $metadata) ?
|
||||
$this->translatableStringHelper->localize($metadata['label']) : $workflow->getName();
|
||||
|
||||
$workflowsList[] = ['name' => $workflow->getName(), 'text' => $text];
|
||||
@@ -44,14 +43,14 @@ class MetadataExtractor
|
||||
return $workflowsList;
|
||||
}
|
||||
|
||||
public function buildArrayPresentationForPlace(EntityWorkflow $entityWorkflow, ?EntityWorkflowStep $step = null): array
|
||||
public function buildArrayPresentationForPlace(EntityWorkflow $entityWorkflow, EntityWorkflowStep $step = null): array
|
||||
{
|
||||
$workflow = $this->registry->get($entityWorkflow, $entityWorkflow->getWorkflowName());
|
||||
$step ??= $entityWorkflow->getCurrentStep();
|
||||
|
||||
$markingMetadata = $workflow->getMetadataStore()->getPlaceMetadata($step->getCurrentStep());
|
||||
|
||||
$text = array_key_exists('label', $markingMetadata) ?
|
||||
$text = \array_key_exists('label', $markingMetadata) ?
|
||||
$this->translatableStringHelper->localize($markingMetadata['label']) : $step->getCurrentStep();
|
||||
|
||||
return ['name' => $step->getCurrentStep(), 'text' => $text];
|
||||
@@ -68,7 +67,7 @@ class MetadataExtractor
|
||||
|
||||
return [
|
||||
'name' => $transition->getName(),
|
||||
'text' => array_key_exists('label', $metadata) ?
|
||||
'text' => \array_key_exists('label', $metadata) ?
|
||||
$this->translatableStringHelper->localize($metadata['label']) : $transition->getName(),
|
||||
'isForward' => $metadata['isForward'] ?? null,
|
||||
];
|
||||
@@ -81,7 +80,7 @@ class MetadataExtractor
|
||||
public function buildArrayPresentationForWorkflow(WorkflowInterface $workflow): array
|
||||
{
|
||||
$metadata = $workflow->getMetadataStore()->getWorkflowMetadata();
|
||||
$text = array_key_exists('label', $metadata) ?
|
||||
$text = \array_key_exists('label', $metadata) ?
|
||||
$this->translatableStringHelper->localize($metadata['label']) : $workflow->getName();
|
||||
|
||||
return ['name' => $workflow->getName(), 'text' => $text];
|
||||
|
Reference in New Issue
Block a user