12
12
* Returns an OpenTelemetry tracer instance. If OpenTelemetry is not enabled,
13
13
* a NoopTracer will be returned instead making this function safe to call
14
14
* in all environments.
15
- *
16
- * @return TracerInterface
17
15
*/
18
16
function tracer (): TracerInterface
19
17
{
@@ -27,10 +25,10 @@ function tracer(): TracerInterface
27
25
* be ended when the callable returns or throws an exception. The callable may
28
26
* modify the active span by accepting a SpanInterface as its first argument.
29
27
*
30
- * @param string $name The name of the span
31
- * @param callable $callable A callable that will be executed within the span context. The activated Span will be passed as the first argument.
32
- * @param int $kind The kind of span to create. Defaults to SpanKind::KIND_INTERNAL
33
- * @param iterable $attributes Attributes to add to the span. Defaults to an empty array, but can be any iterable.
28
+ * @param string $name The name of the span
29
+ * @param callable $callable A callable that will be executed within the span context. The activated Span will be passed as the first argument.
30
+ * @param int $kind The kind of span to create. Defaults to SpanKind::KIND_INTERNAL
31
+ * @param iterable $attributes Attributes to add to the span. Defaults to an empty array, but can be any iterable.
34
32
* @return mixed The result of the callable
35
33
*
36
34
* @throws Throwable If the callable throws an exception, it will be rethrown and the span will be ended with the exception recorded.
@@ -43,9 +41,8 @@ function span(string $name, callable $callable, int $kind = SpanKind::KIND_INTER
43
41
44
42
if (! function_exists ('span_event ' )) {
45
43
/**
46
- * @param string $name Event name
47
- * @param iterable $attributes Event attributes
48
- * @return SpanInterface
44
+ * @param string $name Event name
45
+ * @param iterable $attributes Event attributes
49
46
*/
50
47
function span_event (string $ name , iterable $ attributes = []): SpanInterface
51
48
{
@@ -55,9 +52,8 @@ function span_event(string $name, iterable $attributes = []): SpanInterface
55
52
56
53
if (! function_exists ('span_attribute ' )) {
57
54
/**
58
- * @param string $name Attribute name
59
- * @param mixed $value Attribute value
60
- * @return SpanInterface
55
+ * @param string $name Attribute name
56
+ * @param mixed $value Attribute value
61
57
*/
62
58
function span_attribute (string $ name , mixed $ value ): SpanInterface
63
59
{
@@ -68,9 +64,6 @@ function span_attribute(string $name, mixed $value): SpanInterface
68
64
if (! function_exists ('span_error ' )) {
69
65
/**
70
66
* Set the Span status to Error with an optional description.
71
- *
72
- * @param string|null $description
73
- * @return SpanInterface
74
67
*/
75
68
function span_error (string $ description = null ): SpanInterface
76
69
{
@@ -82,10 +75,6 @@ function span_error(string $description = null): SpanInterface
82
75
/**
83
76
* Set the Span status to Error if the condition is true. Otherwise, return
84
77
* the current span.
85
- *
86
- * @param bool $condition
87
- * @param string|null $description
88
- * @return SpanInterface
89
78
*/
90
79
function span_error_if (bool $ condition , string $ description = null ): SpanInterface
91
80
{
@@ -97,10 +86,6 @@ function span_error_if(bool $condition, string $description = null): SpanInterfa
97
86
/**
98
87
* Set the Span status to Error if the condition is false. Otherwise, return
99
88
* the current span.
100
- *
101
- * @param bool $condition
102
- * @param string|null $description
103
- * @return SpanInterface
104
89
*/
105
90
function span_error_unless (bool $ condition , string $ description = null ): SpanInterface
106
91
{
0 commit comments