| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | public function getResponse() : Response\Account\Create { |
||
| 29 | |||
| 30 | $payload = [ |
||
| 31 | 'contact' => $this->_buildContactPayload($this->_account->getEmail()), |
||
| 32 | 'termsOfServiceAgreed' => true, |
||
| 33 | ]; |
||
| 34 | |||
| 35 | $jwk = Utilities\RequestSigner::JWKString( |
||
| 36 | $payload, |
||
| 37 | Cache\DirectoryResponse::getInstance()->get()->getNewAccount(), |
||
|
|
|||
| 38 | Cache\NewNonceResponse::getInstance()->get()->getNonce(), |
||
| 39 | $this->_account->getKeyDirectoryPath() |
||
| 40 | ); |
||
| 41 | |||
| 42 | $result = Connector\Connector::getInstance()->request( |
||
| 43 | Connector\Connector::METHOD_POST, |
||
| 44 | Cache\DirectoryResponse::getInstance()->get()->getNewAccount(), |
||
| 45 | $jwk |
||
| 46 | ); |
||
| 47 | |||
| 48 | return new Response\Account\Create($result); |
||
| 49 | } |
||
| 50 | } |