| Total Complexity | 5 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 6 | abstract class WebSocketArgument implements IWebSocketArgumentInterface |
||
| 7 | { |
||
| 8 | protected ?string $reqId; |
||
| 9 | |||
| 10 | protected array $symbols; |
||
| 11 | |||
| 12 | public function __construct(string $symbol, ?string $reqId = null) |
||
| 13 | { |
||
| 14 | $this |
||
| 15 | ->setSymbols($symbol) |
||
| 16 | ->setReqId($reqId); |
||
| 17 | } |
||
| 18 | |||
| 19 | abstract public function getOperation(): string; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param string|null $reqId |
||
| 23 | * @return self |
||
| 24 | */ |
||
| 25 | protected function setReqId(?string $reqId): self |
||
| 26 | { |
||
| 27 | $this->reqId = $reqId; |
||
| 28 | return $this; |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @return string |
||
| 33 | */ |
||
| 34 | public function getReqId(): string |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param string $symbol |
||
| 41 | * @return self |
||
| 42 | */ |
||
| 43 | protected function setSymbols(string $symbol): self |
||
| 44 | { |
||
| 45 | $this->symbols = explode(',', $symbol); |
||
| 46 | return $this; |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @return string |
||
| 51 | */ |
||
| 52 | public function getSymbols(): array |
||
| 55 | } |
||
| 56 | } |