| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function key(): string |
||
| 35 | { |
||
| 36 | if ($cache = $this->getCache()->get($this->getCacheKey())) { |
||
| 37 | return $cache; |
||
| 38 | } |
||
| 39 | |||
| 40 | $response = $this->resolveResponse($this->requestRaw(self::ENDPOINT), 'array'); |
||
| 41 | |||
| 42 | if ($response['return_code'] === 'SUCCESS') { |
||
| 43 | $this->getCache()->set($this->getCacheKey(), $key = $response['sandbox_signkey'], 24 * 3600); |
||
| 44 | |||
| 45 | return $key; |
||
| 46 | } |
||
| 47 | |||
| 48 | throw new SandboxException($response['return_msg']); |
||
| 49 | } |
||
| 50 | |||
| 73 |