Skip to content

Commit 8d12753

Browse files
committed
minor #18076 Update data_transformers.rst (hbgamra)
This PR was submitted for the 6.2 branch but it was merged into the 5.4 branch instead. Discussion ---------- Update data_transformers.rst Adding return type for addModelTransformer functions params <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `6.x` for features of unreleased versions). --> Commits ------- 2b5b60a Update data_transformers.rst
2 parents 7ee76d0 + 2b5b60a commit 8d12753

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

form/data_transformers.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ class::
7878

7979
$builder->get('tags')
8080
->addModelTransformer(new CallbackTransformer(
81-
function ($tagsAsArray) {
81+
function ($tagsAsArray): string {
8282
// transform the array to a string
8383
return implode(', ', $tagsAsArray);
8484
},
85-
function ($tagsAsString) {
85+
function ($tagsAsString): array {
8686
// transform the string back to an array
8787
return explode(', ', $tagsAsString);
8888
}

0 commit comments

Comments
 (0)