/ src / Control / ControlResult.php
ControlResult.php
 1  <?php
 2  
 3  namespace BitcoindRPC\Control;
 4  
 5  use BitcoindRPC\RpcResponse;
 6  
 7  class ControlResult
 8  {
 9      private RpcResponse $response;
10  
11      public function __construct(RpcResponse $response)
12      {
13          $this->response = $response;
14      }
15  
16      public function isSuccess(): bool
17      {
18          return $this->response->isSuccess();
19      }
20  
21      public function getData(): mixed
22      {
23          return $this->response->getData();
24      }
25  
26      public function getError(): ?string
27      {
28          return $this->response->getError();
29      }
30  
31      public function getStatusCode(): int
32      {
33          return $this->response->getStatusCode();
34      }
35  
36      public function toArray(): array
37      {
38          return $this->response->toArray();
39      }
40  }