| Total Complexity | 10 |
| Total Lines | 112 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class CurlResponseDto implements ICurlResponseDtoInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var \DateTime $time |
||
| 12 | */ |
||
| 13 | private \DateTime $time; |
||
| 14 | /** |
||
| 15 | * @var int $retCode |
||
| 16 | */ |
||
| 17 | private int $retCode; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var string $retMsg |
||
| 21 | */ |
||
| 22 | private string $retMsg; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var array $retExtInfo |
||
| 26 | */ |
||
| 27 | private array $retExtInfo = []; |
||
| 28 | |||
| 29 | private ICollectionInterface $body; |
||
| 30 | |||
| 31 | |||
| 32 | /** |
||
| 33 | * @param int $code |
||
| 34 | * @return CurlResponseDto |
||
| 35 | */ |
||
| 36 | public function setReturnCode(int $code): self |
||
| 37 | { |
||
| 38 | $this->retCode = $code; |
||
| 39 | return $this; |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @return int |
||
| 44 | */ |
||
| 45 | public function getReturnCode(): int |
||
| 46 | { |
||
| 47 | return $this->retCode; |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @param string $message |
||
| 52 | * @return CurlResponseDto |
||
| 53 | */ |
||
| 54 | public function setReturnMessage(string $message): self |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @return string |
||
| 62 | */ |
||
| 63 | public function getReturnMessage(): string |
||
| 64 | { |
||
| 65 | return $this->retMsg; |
||
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @param array $extInfo |
||
| 70 | * @return CurlResponseDto |
||
| 71 | */ |
||
| 72 | public function setReturnExtendedInfo(array $extInfo): self |
||
| 73 | { |
||
| 74 | $this->retExtInfo = $extInfo; |
||
| 75 | return $this; |
||
| 76 | } |
||
| 77 | |||
| 78 | /** |
||
| 79 | * @return array |
||
| 80 | */ |
||
| 81 | public function getReturnExtendedInfo(): array |
||
| 82 | { |
||
| 83 | return $this->retExtInfo; |
||
| 84 | } |
||
| 85 | |||
| 86 | /** |
||
| 87 | * @param int $time |
||
| 88 | * @return CurlResponseDto |
||
| 89 | */ |
||
| 90 | public function setTime(int $time): self |
||
| 91 | { |
||
| 92 | $this->time = DateTimeHelper::makeFromTimestamp($time); |
||
| 93 | return $this; |
||
| 94 | } |
||
| 95 | |||
| 96 | /** |
||
| 97 | * @return \DateTime |
||
| 98 | */ |
||
| 99 | public function getTime(): \DateTime |
||
| 102 | } |
||
| 103 | |||
| 104 | /** |
||
| 105 | * @param $collection |
||
| 106 | * @return $this |
||
| 107 | */ |
||
| 108 | public function setBody($collection): self |
||
| 109 | { |
||
| 110 | $this->body = $collection; |
||
| 111 | return $this; |
||
| 112 | } |
||
| 113 | |||
| 114 | /** |
||
| 115 | * @return array|null |
||
| 116 | */ |
||
| 117 | public function getBody(): ICollectionInterface |
||
| 120 | } |
||
| 121 | } |