Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## [Unreleased]

### Changed

- Requires `innmind/immutable:~5.16`
- Requires `innmind/graphviz:~4.0`

### Fixed

- PHP `8.4` deprecations
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ Factory::build()
Render::of()($trace)
),
)
->unwrap()
->wait();
```

**Note**: the svg rendered contains links to the files where call frames and exceptions occured, you can change the link by providing an instance of [`Link`](src/Link.php) to the `Render` object.
> [!NOTE]
> The svg rendered contains links to the files where call frames and exceptions occured, you can change the link by providing an instance of [`Link`](src/Link.php) to the `Render` object.

Example of a rendered stack trace: ![](graph.svg)
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
},
"require": {
"php": "~8.2",
"innmind/immutable": "~4.1|~5.0",
"innmind/url": "~4.0",
"innmind/graphviz": "~3.1"
"innmind/immutable": "~5.16",
"innmind/url": "~4.4",
"innmind/graphviz": "~4.0"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 3 additions & 0 deletions src/Render.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,12 @@ private function linkSource(

/**
* Remove special characters and escape backslashes
*
* @return non-empty-string
*/
private function clean(string $name): string
{
/** @var non-empty-string */
return Str::of($name)
->replace("\x00", '') // remove the invisible character used in the name of anonymous classes
->replace('\\', '\\\\')
Expand Down