| Total Complexity | 5 |
| Total Lines | 70 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | final class Service implements \JsonSerializable |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Type of the destination service (e.g. 'db', 'elasticsearch'). |
||
| 11 | * Should typically be the same as span.type. |
||
| 12 | * |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | private $type; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Identifier for the destination service (e.g. 'http://elastic.co', 'elasticsearch', 'rabbitmq') |
||
| 19 | * |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | private $name; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Identifier for the destination service resource being operated on |
||
| 26 | * (e.g. 'http://elastic.co:80', 'elasticsearch', 'rabbitmq/queue_name') |
||
| 27 | * |
||
| 28 | * @var string |
||
| 29 | */ |
||
| 30 | private $resource; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @param string $type |
||
| 34 | * @param string $name |
||
| 35 | * @param string $resource |
||
| 36 | */ |
||
| 37 | 2 | public function __construct($type, $name, $resource) |
|
| 38 | { |
||
| 39 | 2 | $this->type = $type; |
|
| 40 | 2 | $this->name = $name; |
|
| 41 | 2 | $this->resource = $resource; |
|
| 42 | 2 | } |
|
| 43 | |||
| 44 | /** |
||
| 45 | * @return string |
||
| 46 | */ |
||
| 47 | 1 | public function type() |
|
| 48 | { |
||
| 49 | 1 | return $this->type; |
|
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | 1 | public function name() |
|
| 56 | { |
||
| 57 | 1 | return $this->name; |
|
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @return string |
||
| 62 | */ |
||
| 63 | 1 | public function resource() |
|
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @return array |
||
| 70 | */ |
||
| 71 | 1 | public function jsonSerialize() |
|
| 80 |