| Total Complexity | 4 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class GetDataSerializer |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var \BitWasp\Buffertools\Types\Vector |
||
| 18 | */ |
||
| 19 | private $vectorInt; |
||
| 20 | 96 | ||
| 21 | /** |
||
| 22 | 96 | * @param InventorySerializer $inv |
|
| 23 | 96 | */ |
|
| 24 | public function __construct(InventorySerializer $inv) |
||
| 27 | } |
||
| 28 | 3 | ||
| 29 | /** |
||
| 30 | 3 | * @param Parser $parser |
|
| 31 | 3 | * @return GetData |
|
| 32 | 3 | */ |
|
| 33 | 3 | public function fromParser(Parser $parser): GetData |
|
| 34 | 3 | { |
|
| 35 | $addrs = $this->vectorInt->read($parser); |
||
| 36 | return new GetData($addrs); |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param BufferInterface $data |
||
| 41 | 3 | * @return GetData |
|
| 42 | */ |
||
| 43 | 3 | public function parse(BufferInterface $data): GetData |
|
| 44 | 3 | { |
|
| 45 | return $this->fromParser(new Parser($data)); |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @param GetData $getData |
||
| 50 | * @return BufferInterface |
||
| 51 | 3 | */ |
|
| 52 | public function serialize(GetData $getData): BufferInterface |
||
| 55 | } |
||
| 56 | } |
||
| 57 |