| Conditions | 2 |
| Paths | 2 |
| Total Lines | 31 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | public function getResponse() : Response\Order\Create { |
||
| 30 | |||
| 31 | $identifiers = []; |
||
| 32 | foreach($this->_order->getSubjects() as $subject) { |
||
| 33 | |||
| 34 | $identifiers[] = [ |
||
| 35 | 'type' => 'dns', |
||
| 36 | 'value' => $subject |
||
| 37 | ]; |
||
| 38 | } |
||
| 39 | |||
| 40 | $payload = [ |
||
| 41 | 'identifiers' => $identifiers, |
||
| 42 | 'notBefore' => '', |
||
| 43 | 'notAfter' => '', |
||
| 44 | ]; |
||
| 45 | |||
| 46 | $kid = Utilities\RequestSigner::KID( |
||
| 47 | $payload, |
||
| 48 | Cache\AccountResponse::getInstance()->get($this->_order->getAccount())->getLocation(), |
||
|
|
|||
| 49 | Cache\DirectoryResponse::getInstance()->get()->getNewOrder(), |
||
| 50 | Cache\NewNonceResponse::getInstance()->get()->getNonce(), |
||
| 51 | $this->_order->getAccount()->getKeyDirectoryPath() |
||
| 52 | ); |
||
| 53 | $result = Connector\Connector::getInstance()->request( |
||
| 54 | Connector\Connector::METHOD_POST, |
||
| 55 | Cache\DirectoryResponse::getInstance()->get()->getNewOrder(), |
||
| 56 | $kid |
||
| 57 | ); |
||
| 58 | |||
| 59 | return new Response\Order\Create($result); |
||
| 60 | } |
||
| 61 | } |