File tree Expand file tree Collapse file tree 4 files changed +30
-7
lines changed Expand file tree Collapse file tree 4 files changed +30
-7
lines changed Original file line number Diff line number Diff line change 1
-
2
1
# PHP OpenTracing API using Jaeger
3
2
4
-
5
3
## Installation
6
4
7
- ```
5
+ ``` bash
8
6
composer require code-tool/jaeger-client-php
9
7
```
10
8
11
9
## Getting Started
12
10
13
- It is strictly advised to use any form of DI container (e.g. [ Symfony] ( https://github.com/code-tool/jaeger-client-symfony-bridge ) ).
14
- ``` $xslt
11
+ It is strictly advised to use any form of DI container (e.g. [ Symfony Bundle] ( https://github.com/code-tool/jaeger-client-symfony-bridge ) ).
12
+
13
+ ``` php
15
14
<?php
16
15
16
+ use Jaeger\Tag\StringTag;
17
+ use Jaeger\Tracer\TracerInterface;
18
+
19
+ /** @var TracerInterface $tracer */
20
+
17
21
$span = $tracer->start('Parent Operation Name', [new StringTag('test.tag', 'Hello world in parent')]);
18
22
$childSpan = $tracer->start('Child Operation Name', [new StringTag('test.tag', 'Hello world in child')]);
19
23
$tracer->finish($childSpan);
Original file line number Diff line number Diff line change 9
9
"require" : {
10
10
"php" : " >=7.1" ,
11
11
"ext-sockets" : " *" ,
12
- "apache/thrift" : " >=0.11, <0.16" ,
13
- "psr/log" : " ^1.0.2"
12
+ "apache/thrift" : " >=0.11, <0.16"
14
13
},
15
14
"require-dev" : {
16
15
"phpunit/phpunit" : " @stable"
Original file line number Diff line number Diff line change @@ -7,11 +7,19 @@ class CodecRegistry implements \ArrayAccess
7
7
{
8
8
private $ codecs = [];
9
9
10
+ /**
11
+ * @return bool
12
+ */
13
+ #[\ReturnTypeWillChange]
10
14
public function offsetExists ($ offset )
11
15
{
12
16
return array_key_exists ($ offset , $ this ->codecs );
13
17
}
14
18
19
+ /**
20
+ * @return mixed
21
+ */
22
+ #[\ReturnTypeWillChange]
15
23
public function offsetGet ($ offset )
16
24
{
17
25
if (false === array_key_exists ($ offset , $ this ->codecs )) {
@@ -21,13 +29,21 @@ public function offsetGet($offset)
21
29
return $ this ->codecs [$ offset ];
22
30
}
23
31
32
+ /**
33
+ * @return $this
34
+ */
35
+ #[\ReturnTypeWillChange]
24
36
public function offsetSet ($ offset , $ value )
25
37
{
26
38
$ this ->codecs [$ offset ] = $ value ;
27
39
28
40
return $ this ;
29
41
}
30
42
43
+ /**
44
+ * @return $this
45
+ */
46
+ #[\ReturnTypeWillChange]
31
47
public function offsetUnset ($ offset )
32
48
{
33
49
if (false === array_key_exists ($ offset , $ this ->codecs )) {
Original file line number Diff line number Diff line change @@ -64,6 +64,10 @@ public function getBaggage(): array
64
64
return $ this ->baggage ;
65
65
}
66
66
67
+ /**
68
+ * @return \Traversable
69
+ */
70
+ #[\ReturnTypeWillChange]
67
71
public function getIterator ()
68
72
{
69
73
return new \ArrayIterator ($ this ->baggage );
You can’t perform that action at this time.
0 commit comments