From 2507ab5bafdb7622e6413469c970ac296c193a16 Mon Sep 17 00:00:00 2001 From: Lars Date: Thu, 3 Aug 2023 19:42:38 -0300 Subject: [PATCH] Debugging producers: Replace echo with variable assignment Use of echo will result in invalid json output. --- doc/producers/composing.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/producers/composing.md b/doc/producers/composing.md index b6f22429b..457bf4c4f 100644 --- a/doc/producers/composing.md +++ b/doc/producers/composing.md @@ -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') @@ -49,7 +49,7 @@ 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') @@ -57,14 +57,14 @@ Note that you can always easily tap into the chain and e.g. use xdebug to debug ->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; })) ) );