Helpers
class Helpers
Rendering helpers for Debugger.
Methods
Returns HTML link to editor.
Returns link to editor.
Formats an HTML string by replacing each % placeholder with the next argument, HTML-escaped.
No description
No description
No description
Finds the file+line in user code from which a Tracy call originated.
Returns the index of the first user-visible frame in $trace. A frame is transparent when its file is missing, synthetic, in $paths, or its containing function (trace[n+1]) is annotated @tracySkipLocation.
No description
No description
No description
No description
No description
Finds the best suggestion.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Decomposes an integer flags value into matching constant names.
Encodes a value to JSON safe for use in any HTML context (attributes, script tags, etc.)
Details
at line 22
static string
editorLink(string $file, int|null $line = null)
Returns HTML link to editor.
at line 52
static string|null
editorUri(string $file, int|null $line = null, string $action = 'open', string $search = '', string $replace = '', int|null $column = null)
Returns link to editor.
at line 82
static string
formatHtml(string $mask)
Formats an HTML string by replacing each % placeholder with the next argument, HTML-escaped.
at line 91
static string
escapeHtml(mixed $s)
No description
at line 97
static string
escapeMd(mixed $s)
No description
at line 109
static string
htmlToText(string $s)
No description
at line 120
static array|null
findCallerLocation(array|null $paths = null)
Finds the file+line in user code from which a Tracy call originated.
at line 138
static int
countTransparentFrames(array $trace, array|null $paths = null)
| internal |
Returns the index of the first user-visible frame in $trace. A frame is transparent when its file is missing, synthetic, in $paths, or its containing function (trace[n+1]) is annotated @tracySkipLocation.
at line 172
static array|null
findTrace(array $trace, array|string $method, int|null $index = null)
No description
at line 192
static string
errorTypeToString(int $type)
| internal |
No description
at line 215
static string
getSource()
| internal |
No description
at line 233
static void
improveException(Throwable $e)
| internal |
No description
at line 309
static string
improveError(string $message)
| internal |
No description
at line 323
static string|null
guessClassFile(string $class)
| internal |
No description
at line 352
static string|null
getSuggestion(array $items, string $value)
| internal |
Finds the best suggestion.
at line 369
static bool
isHtmlMode()
| internal |
No description
at line 380
static void
consoleLog(string $data)
| internal |
No description
at line 387
static bool
isAgent()
| internal |
No description
at line 394
static bool
isRedirect()
| internal |
No description
at line 401
static string
createId()
| internal |
No description
at line 408
static bool
isCli()
| internal |
No description
at line 415
static string|null
getNonce(bool $attr = false)
| internal |
No description
at line 442
static string
capture(callable $func)
No description
at line 456
static string
encodeString(string $s, int|null $maxLength = null, bool $showWhitespaces = true)
| internal |
No description
at line 518
static int
utf8Length(string $s)
| internal |
No description
at line 529
static bool
isUtf8(string $s)
| internal |
No description
at line 536
static string
truncateString(string $s, int $len, bool $utf8)
| internal |
No description
at line 557
static string
htmlToAnsi(string $s, array $colors)
| internal |
No description
at line 579
static string
minifyJs(string $s)
| internal |
No description
at line 624
static string
minifyCss(string $s)
| internal |
No description
at line 662
static bool
detectColors()
No description
at line 675
static array
getExceptionChain(Throwable $ex)
No description
at line 690
static void
traverseValue(mixed $val, callable $callback, array $skip = [], string|null $refId = null)
No description
at line 724
static array|null
decomposeFlags(int $flags, bool $set, array $constants)
| internal |
Decomposes an integer flags value into matching constant names.
When $set is true, finds all flags set in the value (bitmask decomposition). When $set is false, finds a single constant that equals the value exactly.
at line 751
static string
jsonEncode(mixed $value, bool $inScript = false)
Encodes a value to JSON safe for use in any HTML context (attributes, script tags, etc.)