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

[9.x] Add dontIncludeSource to CliDumper and HtmlDumper #44623

Merged
merged 2 commits into from
Oct 19, 2022
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
16 changes: 15 additions & 1 deletion src/Illuminate/Foundation/Concerns/ResolvesDumpSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ trait ResolvesDumpSource
/**
* The source resolver.
*
* @var (callable(): (array{0: string, 1: string, 2: int|null}|null))|null
* @var (callable(): (array{0: string, 1: string, 2: int|null}|null))|null|false
*/
protected static $dumpSourceResolver;

Expand All @@ -43,6 +43,10 @@ trait ResolvesDumpSource
*/
public function resolveDumpSource()
{
if (static::$dumpSourceResolver === false) {
return null;
}

if (static::$dumpSourceResolver) {
return call_user_func(static::$dumpSourceResolver);
}
Expand Down Expand Up @@ -161,4 +165,14 @@ public static function resolveDumpSourceUsing($callable)
{
static::$dumpSourceResolver = $callable;
}

/**
* Don't include the location / file of the dump in dumps.
*
* @return void
*/
public static function dontIncludeSource()
{
static::$dumpSourceResolver = false;
}
}