Skip to content

Commit

Permalink
docs(sompose): Replace echo with variable assignment to prevent inval…
Browse files Browse the repository at this point in the history
…id JSON output (#1345)
  • Loading branch information
osopolar authored Nov 11, 2023
1 parent 72476b9 commit 3dd570c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/producers/composing.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Note that you can always easily tap into the chain and e.g. use xdebug to debug
$builder->compose(
$builder->tap($builder->callback(function ($parent, $args) {
// YOU CAN SET A XDEBUG BREAKPOINT IN THESE CALLBACKS TO CHECK THE VALUES.
echo("Compose step 0.");
$compose_step = 0;
})),
// Load the file object from the field.
$builder->produce('property_path')
Expand All @@ -49,22 +49,22 @@ Note that you can always easily tap into the chain and e.g. use xdebug to debug
->map('path', $builder->fromValue('YOUR_FIELD_NAME.YOUR_FIELD_PROPERTY')),
$builder->tap($builder->callback(function ($parent, $args) {
// YOU CAN SET A XDEBUG BREAKPOINT IN THESE CALLBACKS TO CHECK THE VALUES.
echo("Compose step 1.");
$compose_step = 1;
})),
// Load the image style derivative of the file.
$builder->produce('image_derivative')
->map('entity', $builder->fromParent())
->map('style', $builder->fromValue('YOUR_IMAGE_STYLE')),
$builder->tap($builder->callback(function ($parent, $args) {
// YOU CAN SET A XDEBUG BREAKPOINT IN THESE CALLBACKS TO CHECK THE VALUES.
echo("Compose step 2.");
$compose_step = 2;
})),
// Retrieve the url of the generated image.
$builder->produce('image_style_url')
->map('derivative', $builder->fromParent()),
$builder->tap($builder->callback(function ($parent, $args) {
// YOU CAN SET A XDEBUG BREAKPOINT IN THESE CALLBACKS TO CHECK THE VALUES.
echo("Compose step 3.");
$compose_step = 3;
}))
)
);
Expand Down

0 comments on commit 3dd570c

Please sign in to comment.