| 1 | <?php |
||
| 10 | final class Span implements JsonSerializable |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var int|null |
||
| 14 | */ |
||
| 15 | private $id; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var mixed[] |
||
| 19 | */ |
||
| 20 | private $context = []; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var float |
||
| 24 | */ |
||
| 25 | private $duration; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var string |
||
| 29 | */ |
||
| 30 | private $name; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @var int|null |
||
| 34 | */ |
||
| 35 | private $parentId; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @var StackTraceFrame[] |
||
| 39 | */ |
||
| 40 | private $stackTraceFrameList = []; |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @var float |
||
| 44 | */ |
||
| 45 | private $startOffset; |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @var string |
||
| 49 | */ |
||
| 50 | private $type; |
||
| 51 | |||
| 52 | 61 | public function __construct(float $duration, string $name, float $startOffset, string $type) |
|
| 59 | |||
| 60 | 1 | public function withId(int $id): self |
|
| 67 | |||
| 68 | /** |
||
| 69 | * @param mixed $value |
||
| 70 | */ |
||
| 71 | 1 | public function withContext(string $name, $value): self |
|
| 78 | |||
| 79 | 1 | public function withParent(Span $parent): self |
|
| 86 | |||
| 87 | 1 | public function withStackTraceFrame(StackTraceFrame ...$frame): self |
|
| 94 | |||
| 95 | /** |
||
| 96 | * @return mixed[] |
||
| 97 | */ |
||
| 98 | 26 | public function jsonSerialize(): array |
|
| 111 | } |
||
| 112 |