Skip to content

Commit fa1d942

Browse files
author
Kirill Nesmeyanov
committed
Add more context options
1 parent 25d414f commit fa1d942

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Runtime/Repository/TraceableTypeRepository/TraceableType.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private static function getPath(Context $context): array
5656
}
5757

5858
/** @var list<non-empty-string> */
59-
return $result;
59+
return \array_reverse($result);
6060
}
6161

6262
private static function getCurrentPath(Context $context): string
@@ -79,6 +79,8 @@ public function match(mixed $value, Context $context): bool
7979

8080
try {
8181
$span->setAttribute('value', $value);
82+
$span->setAttribute('direction', $context->isNormalization() ? 'normalization' : 'denormalization');
83+
$span->setAttribute('path', self::getPath($context));
8284

8385
$result = $this->delegate->match($value, $context);
8486

@@ -99,6 +101,8 @@ public function cast(mixed $value, Context $context): mixed
99101

100102
try {
101103
$span->setAttribute('value', $value);
104+
$span->setAttribute('direction', $context->isNormalization() ? 'normalization' : 'denormalization');
105+
$span->setAttribute('path', self::getPath($context));
102106

103107
$result = $this->delegate->cast($value, $context);
104108

0 commit comments

Comments
 (0)