GetNewNonce::getResponse()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 8
ccs 0
cts 4
cp 0
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace LE_ACME2\Request;
4
5
use LE_ACME2\Response;
6
7
use LE_ACME2\Connector;
8
use LE_ACME2\Cache;
9
use LE_ACME2\Exception;
10
11
class GetNewNonce extends AbstractRequest {
12
13
    /**
14
     * @throws Exception\InvalidResponse
15
     * @throws Exception\RateLimitReached
16
     * @throws Exception\ServiceUnavailable
17
     */
18
    public function getResponse() : Response\GetNewNonce {
19
20
        $result = Connector\Connector::getInstance()->request(
0 ignored issues
show
Bug introduced by
It seems like request() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
        $result = Connector\Connector::getInstance()->/** @scrutinizer ignore-call */ request(
Loading history...
21
            Connector\Connector::METHOD_HEAD,
22
            Cache\DirectoryResponse::getInstance()->get()->getNewNonce()
0 ignored issues
show
Bug introduced by
It seems like get() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

22
            Cache\DirectoryResponse::getInstance()->/** @scrutinizer ignore-call */ get()->getNewNonce()
Loading history...
23
        );
24
25
        return new Response\GetNewNonce($result);
26
    }
27
}