File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public function __construct(
1717
1818 public function getStatementByDefinition (#[Language('PHP ' )] string $ definition ): TypeStatement
1919 {
20- $ span = $ this ->tracer ->start (\sprintf ('Parse definition [%s] ' , $ definition ));
20+ $ span = $ this ->tracer ->start (\sprintf ('Parse "%s" ' , $ definition ));
2121
2222 try {
2323 $ span ->setAttribute ('value ' , $ definition );
Original file line number Diff line number Diff line change 88use TypeLang \Mapper \Runtime \Tracing \TracerInterface ;
99use TypeLang \Mapper \Type \TypeInterface ;
1010use TypeLang \Parser \Node \Stmt \TypeStatement ;
11+ use TypeLang \Printer \PrettyPrinter ;
12+ use TypeLang \Printer \PrinterInterface as TypePrinterInterface ;
1113
1214final class TraceableTypeRepository extends TypeRepositoryDecorator
1315{
16+ private readonly TypePrinterInterface $ printer ;
17+
1418 public function __construct (
1519 private readonly TracerInterface $ tracer ,
1620 TypeRepositoryInterface $ delegate ,
1721 ) {
1822 parent ::__construct ($ delegate );
23+
24+ $ this ->printer = new PrettyPrinter ();
1925 }
2026
2127 public function getTypeByStatement (TypeStatement $ statement , ?\ReflectionClass $ context = null ): TypeInterface
2228 {
23- $ span = $ this ->tracer ->start (\sprintf ('Fetching by statement "%s" ' , \get_debug_type ($ statement )));
29+ $ span = $ this ->tracer ->start (\vsprintf ('Fetch type "%s" ' , [
30+ $ this ->printer ->print ($ statement ),
31+ ]));
2432
2533 try {
2634 $ span ->setAttribute ('value ' , $ statement );
You can’t perform that action at this time.
0 commit comments