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

Trap options: if(), once(), times(), depth() #29

Merged
merged 9 commits into from
Nov 26, 2023
Merged

Conversation

roxblnfk
Copy link
Member

@roxblnfk roxblnfk commented Nov 26, 2023

// Limit the depth of the dumped structure
trap($veryDeepArray)->depth(3);

foreach ($veryLargeArray as $item) {
    // We don't need to dump more than 3 items
    trap($item)->times(3);
}

// Dump only if the condition is true
trap($animal)->once()->if($var instanceof Animal\Cat);

@roxblnfk roxblnfk added this to the 1.1.x milestone Nov 26, 2023
@roxblnfk roxblnfk added the enhancement New feature or request label Nov 26, 2023
@roxblnfk roxblnfk marked this pull request as ready for review November 26, 2023 15:38
@roxblnfk roxblnfk merged commit 0eb5d12 into master Nov 26, 2023
16 checks passed
@roxblnfk roxblnfk deleted the new-features branch November 26, 2023 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant