Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging producers: Replace echo with variable assignment #1345

Merged
merged 3 commits into from
Nov 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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