Total Complexity | 8 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | final class Span implements \JsonSerializable |
||
9 | { |
||
10 | use SpanType; |
||
11 | use SpanSubtype; |
||
12 | |||
13 | /** |
||
14 | * @param string $type |
||
15 | * @param string|null $subtype |
||
16 | */ |
||
17 | 5 | public function __construct($type, $subtype) |
|
24 | 3 | } |
|
25 | |||
26 | /** |
||
27 | * @param mixed $type |
||
28 | * |
||
29 | * @return void |
||
30 | */ |
||
31 | 5 | private function assertType($type) |
|
35 | } |
||
36 | 4 | } |
|
37 | |||
38 | /** |
||
39 | * @param mixed $subtype |
||
40 | * |
||
41 | * @return void |
||
42 | */ |
||
43 | 4 | private function assertSubType($subtype) |
|
44 | { |
||
45 | 4 | if (null !== $subtype && false === is_string($subtype)) { |
|
46 | 1 | throw new \InvalidArgumentException('The [subType] must be of type string or null.'); |
|
47 | } |
||
48 | 3 | } |
|
49 | |||
50 | /** |
||
51 | * @return array |
||
52 | */ |
||
53 | 2 | public function jsonSerialize() |
|
64 | } |
||
65 | } |
||
66 |