Skip to content

Commit

Permalink
fix phpstan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
solverat committed Aug 30, 2023
1 parent 62270df commit fa80984
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Controller/Admin/OutputWorkflowFunnelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function getFunnelLayersAction(Request $request): JsonResponse
'groups' => ['ExtJs'],
AbstractNormalizer::CALLBACKS => [
'label' => function ($data) {
return $this->trans($data, [], 'messages');
return $this->translator->trans($data, [], 'messages');
}
]
]
Expand Down
20 changes: 18 additions & 2 deletions src/Factory/ObjectResolverFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
use FormBuilderBundle\OutputWorkflow\Channel\Object\NewObjectResolver;
use FormBuilderBundle\Registry\DynamicObjectResolverRegistry;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

class ObjectResolverFactory implements ObjectResolverFactoryInterface
{
public function __construct(
protected TranslatorInterface $translator,
protected DynamicObjectResolverRegistry $dynamicObjectResolverRegistry,
protected FormValuesOutputApplierInterface $formValuesOutputApplier,
protected EventDispatcherInterface $eventDispatcher,
Expand All @@ -21,11 +23,25 @@ public function __construct(

public function createForNewObject(array $objectMappingData): NewObjectResolver
{
return new NewObjectResolver($this->formValuesOutputApplier, $this->eventDispatcher, $this->modelFactory, $this->dynamicObjectResolverRegistry, $objectMappingData);
return new NewObjectResolver(
$this->translator,
$this->formValuesOutputApplier,
$this->eventDispatcher,
$this->modelFactory,
$this->dynamicObjectResolverRegistry,
$objectMappingData
);
}

public function createForExistingObject(array $objectMappingData): ExistingObjectResolver
{
return new ExistingObjectResolver($this->formValuesOutputApplier, $this->eventDispatcher, $this->modelFactory, $this->dynamicObjectResolverRegistry, $objectMappingData);
return new ExistingObjectResolver(
$this->translator,
$this->formValuesOutputApplier,
$this->eventDispatcher,
$this->modelFactory,
$this->dynamicObjectResolverRegistry,
$objectMappingData
);
}
}

0 comments on commit fa80984

Please sign in to comment.