| 1 | <?php |
||
| 9 | final class Service implements JsonSerializable |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var VersionedName |
||
| 13 | */ |
||
| 14 | private $agent; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | private $name; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var VersionedName|null |
||
| 23 | */ |
||
| 24 | private $framework; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var VersionedName|null |
||
| 28 | */ |
||
| 29 | private $language; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var string|null |
||
| 33 | */ |
||
| 34 | private $environment; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @var VersionedName|null |
||
| 38 | */ |
||
| 39 | private $runtime; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @var string|null |
||
| 43 | */ |
||
| 44 | private $version; |
||
| 45 | |||
| 46 | 42 | public function __construct(VersionedName $agent, string $name) |
|
| 51 | |||
| 52 | 1 | public function usingFramework(VersionedName $framework): self |
|
| 59 | |||
| 60 | 1 | public function usingLanguage(VersionedName $language): self |
|
| 67 | |||
| 68 | 1 | public function inEnvironment(string $environment): self |
|
| 75 | |||
| 76 | 1 | public function withRuntime(VersionedName $runtime): self |
|
| 83 | |||
| 84 | 1 | public function atVersion(string $version): self |
|
| 91 | |||
| 92 | /** |
||
| 93 | * @return mixed[] |
||
| 94 | */ |
||
| 95 | 36 | public function jsonSerialize(): array |
|
| 107 | } |
||
| 108 |