55namespace TypeLang \Mapper \Runtime \Repository \TypeDecorator ;
66
77use TypeLang \Mapper \Runtime \Context ;
8+ use TypeLang \Mapper \Runtime \Context \Direction ;
89use TypeLang \Mapper \Runtime \Path \PathInterface ;
910use TypeLang \Mapper \Runtime \Tracing \TracerInterface ;
1011use TypeLang \Mapper \Type \TypeInterface ;
@@ -29,22 +30,11 @@ public function __construct(
2930
3031 $ inner = $ this ->getDecoratedType ();
3132
32- $ this ->name = self ::getShortName ($ inner ::class)
33- . '# ' . \spl_object_id ($ inner )
34- . ' as " ' . $ this ->definition . '" ' ;
35- }
36-
37- /**
38- * @param non-empty-string $fqn
39- *
40- * @return non-empty-string
41- */
42- private static function getShortName (string $ fqn ): string
43- {
44- /** @var non-empty-list<non-empty-string> $parts */
45- $ parts = \explode ('\\' , $ fqn );
46-
47- return \end ($ parts );
33+ $ this ->name = \vsprintf ('"%s" using %s#%d ' , [
34+ \addcslashes ($ this ->definition , '" ' ),
35+ $ inner ::class,
36+ \spl_object_id ($ inner ),
37+ ]);
4838 }
4939
5040 private static function getPath (Context $ context ): PathInterface
@@ -55,10 +45,10 @@ private static function getPath(Context $context): PathInterface
5545 private static function getDirection (Context $ context ): Context \DirectionInterface
5646 {
5747 if ($ context ->isNormalization ()) {
58- return Context \ Direction::Normalize;
48+ return Direction::Normalize;
5949 }
6050
61- return Context \ Direction::Denormalize;
51+ return Direction::Denormalize;
6252 }
6353
6454 public function match (mixed $ value , Context $ context ): bool
0 commit comments