Skip to content

Commit 3dd570c

Browse files
authored
docs(sompose): Replace echo with variable assignment to prevent invalid JSON output (#1345)
1 parent 72476b9 commit 3dd570c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

doc/producers/composing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Note that you can always easily tap into the chain and e.g. use xdebug to debug
4040
$builder->compose(
4141
$builder->tap($builder->callback(function ($parent, $args) {
4242
// YOU CAN SET A XDEBUG BREAKPOINT IN THESE CALLBACKS TO CHECK THE VALUES.
43-
echo("Compose step 0.");
43+
$compose_step = 0;
4444
})),
4545
// Load the file object from the field.
4646
$builder->produce('property_path')
@@ -49,22 +49,22 @@ Note that you can always easily tap into the chain and e.g. use xdebug to debug
4949
->map('path', $builder->fromValue('YOUR_FIELD_NAME.YOUR_FIELD_PROPERTY')),
5050
$builder->tap($builder->callback(function ($parent, $args) {
5151
// YOU CAN SET A XDEBUG BREAKPOINT IN THESE CALLBACKS TO CHECK THE VALUES.
52-
echo("Compose step 1.");
52+
$compose_step = 1;
5353
})),
5454
// Load the image style derivative of the file.
5555
$builder->produce('image_derivative')
5656
->map('entity', $builder->fromParent())
5757
->map('style', $builder->fromValue('YOUR_IMAGE_STYLE')),
5858
$builder->tap($builder->callback(function ($parent, $args) {
5959
// YOU CAN SET A XDEBUG BREAKPOINT IN THESE CALLBACKS TO CHECK THE VALUES.
60-
echo("Compose step 2.");
60+
$compose_step = 2;
6161
})),
6262
// Retrieve the url of the generated image.
6363
$builder->produce('image_style_url')
6464
->map('derivative', $builder->fromParent()),
6565
$builder->tap($builder->callback(function ($parent, $args) {
6666
// YOU CAN SET A XDEBUG BREAKPOINT IN THESE CALLBACKS TO CHECK THE VALUES.
67-
echo("Compose step 3.");
67+
$compose_step = 3;
6868
}))
6969
)
7070
);

0 commit comments

Comments
 (0)