File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1-
21# PHP OpenTracing API using Jaeger
32
4-
53## Installation
64
7- ```
5+ ``` bash
86composer require code-tool/jaeger-client-php
97```
108
119## Getting Started
1210
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
1514<?php
1615
16+ use Jaeger\Tag\StringTag;
17+ use Jaeger\Tracer\TracerInterface;
18+
19+ /** @var TracerInterface $tracer */
20+
1721$span = $tracer->start('Parent Operation Name', [new StringTag('test.tag', 'Hello world in parent')]);
1822$childSpan = $tracer->start('Child Operation Name', [new StringTag('test.tag', 'Hello world in child')]);
1923$tracer->finish($childSpan);
Original file line number Diff line number Diff line change 99 "require" : {
1010 "php" : " >=7.1" ,
1111 "ext-sockets" : " *" ,
12- "apache/thrift" : " >=0.11, <0.16" ,
13- "psr/log" : " ^1.0.2"
12+ "apache/thrift" : " >=0.11, <0.16"
1413 },
1514 "require-dev" : {
1615 "phpunit/phpunit" : " @stable"
Original file line number Diff line number Diff line change @@ -7,11 +7,19 @@ class CodecRegistry implements \ArrayAccess
77{
88 private $ codecs = [];
99
10+ /**
11+ * @return bool
12+ */
13+ #[\ReturnTypeWillChange]
1014 public function offsetExists ($ offset )
1115 {
1216 return array_key_exists ($ offset , $ this ->codecs );
1317 }
1418
19+ /**
20+ * @return mixed
21+ */
22+ #[\ReturnTypeWillChange]
1523 public function offsetGet ($ offset )
1624 {
1725 if (false === array_key_exists ($ offset , $ this ->codecs )) {
@@ -21,13 +29,21 @@ public function offsetGet($offset)
2129 return $ this ->codecs [$ offset ];
2230 }
2331
32+ /**
33+ * @return $this
34+ */
35+ #[\ReturnTypeWillChange]
2436 public function offsetSet ($ offset , $ value )
2537 {
2638 $ this ->codecs [$ offset ] = $ value ;
2739
2840 return $ this ;
2941 }
3042
43+ /**
44+ * @return $this
45+ */
46+ #[\ReturnTypeWillChange]
3147 public function offsetUnset ($ offset )
3248 {
3349 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
6464 return $ this ->baggage ;
6565 }
6666
67+ /**
68+ * @return \Traversable
69+ */
70+ #[\ReturnTypeWillChange]
6771 public function getIterator ()
6872 {
6973 return new \ArrayIterator ($ this ->baggage );
You can’t perform that action at this time.
0 commit comments