Skip to content

Commit

Permalink
Update Data Transformer return types as per synfony 7
Browse files Browse the repository at this point in the history
  • Loading branch information
On5-Repos committed Jul 25, 2024
1 parent 705d72a commit ad4801c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Form/DataTransformer/ArrayToStringTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(bool $multiple)
$this->multiple = $multiple;
}

public function transform($value)
public function transform($value): mixed
{
if (!$value) {
return $this->multiple ? [] : '';
Expand All @@ -36,7 +36,7 @@ public function transform($value)
return !$this->multiple ? $value : explode(',', $value);
}

public function reverseTransform($value)
public function reverseTransform($value): mixed
{
if (!$value) {
return '';
Expand Down
4 changes: 2 additions & 2 deletions src/Form/DataTransformer/DefaultLabelToLabelsTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
*/
class DefaultLabelToLabelsTransformer implements DataTransformerInterface
{
public function transform($value)
public function transform($value): mixed
{
return $value['default'] ?? '';
}

public function reverseTransform($value)
public function reverseTransform($value): mixed
{
return ['default' => $value];
}
Expand Down

0 comments on commit ad4801c

Please sign in to comment.