Debian Codegraph @

includes/libs/telemetry/NoopSpan.php

raw symbols SCIP
1 <?php
2 namespace Wikimedia\Telemetry;
3
4 /**
5 * An unsampled span that does nothing and persists no data.
6 *
7 * @since 1.43
8 * @internal
9 */
10 class NoopSpan implements SpanInterface {
11 private SpanContext $context;
12
13 public function __construct( SpanContext $context ) {
14 $this->context = $context;
15 }
16
17 /** @inheritDoc */
18 public function getContext(): SpanContext {
19 return $this->context;
20 }
21
22 /** @inheritDoc */
23 public function setAttributes( array $attributes ): SpanInterface {
24 return $this;
25 }
26
27 /** @inheritDoc */
28 public function setSpanKind( int $spanKind ): SpanInterface {
29 return $this;
30 }
31
32 /** @inheritDoc */
33 public function start( ?int $epochNanos = null ): SpanInterface {
34 return $this;
35 }
36
37 /** @inheritDoc */
38 public function end( ?int $epochNanos = null ): void {
39 // no-op
40 }
41
42 /** @inheritDoc */
43 public function activate(): void {
44 // no-op
45 }
46
47 /** @inheritDoc */
48 public function deactivate(): void {
49 // no-op
50 }
51 }