Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Resolvers/InputResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ classInstance: $object,
continue;
}

$chooseContext->addProperty(new ChoosePropertyContext($name, $chooseContext, $collection));
$chooseContext->addProperty(new ChoosePropertyContext($name, $collection, $chooseContext));
$chooseContext->getProperty($name)?->setInputName($matchInput['name']);

$resolvedValue = $matchInput['value'];
Expand Down
2 changes: 1 addition & 1 deletion src/Resolvers/OutputResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ classInstance: $object,
continue;
}

$chooseContext->addProperty(new ChoosePropertyContext($name, $chooseContext, $collection));
$chooseContext->addProperty(new ChoosePropertyContext($name, $collection, $chooseContext));
$chooseContext->getProperty($name)?->setOutPutNames($matchData['names']);
$resolvedValue = $matchData['value'];

Expand Down
2 changes: 1 addition & 1 deletion src/Serialize.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function setGroups(array|string $groups): SerializeContext

public function withGroups(array|string $groups): static
{
$this->getContext()->setGroups((array)$groups);
$this->getContext()?->setGroups((array)$groups);
return $this;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Support/Context/ChoosePropertyContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ class ChoosePropertyContext

public function __construct(
private readonly string $name,
private readonly ?ChooseSerializeContext $parent = null,
private readonly DataCollection $dataCollection,
private readonly ?ChooseSerializeContext $parent = null,
) {

}

public static function build(DataCollection $collection, ChooseSerializeContext $context,DataCollection $dataCollection): ChoosePropertyContext
{
return new self($collection->getName(), $context, $dataCollection);
return new self($collection->getName(), $dataCollection, $context);
}

public function getDataCollection() : DataCollection
Expand Down