| Total Complexity | 3 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | final class Age implements \JsonSerializable |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * The age of the message in milliseconds. |
||
| 12 | * |
||
| 13 | * If the instrumented messaging framework provides a timestamp for the message, agents may use it. |
||
| 14 | * Otherwise, the sending agent can add a timestamp in milliseconds since the Unix epoch to |
||
| 15 | * the message's metadata to be retrieved by the receiving agent. |
||
| 16 | * |
||
| 17 | * If a timestamp is not available, agents should omit this field. |
||
| 18 | * |
||
| 19 | * @var int|null |
||
| 20 | */ |
||
| 21 | private $ms; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param int|null $ms |
||
| 25 | */ |
||
| 26 | 3 | public function __construct($ms = null) |
|
| 27 | { |
||
| 28 | 3 | $this->ms = $ms; |
|
| 29 | 3 | } |
|
| 30 | |||
| 31 | /** |
||
| 32 | * @return int|null |
||
| 33 | */ |
||
| 34 | 1 | public function ms() |
|
| 35 | { |
||
| 36 | 1 | return $this->ms; |
|
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @return array |
||
| 41 | */ |
||
| 42 | 1 | public function jsonSerialize() |
|
| 46 | 1 | ]; |
|
| 47 | } |
||
| 48 | } |
||
| 49 |