Passed
Branch master (fc5382)
by Fabian
03:13
created

GetDirectory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
dl 0
loc 16
ccs 0
cts 6
cp 0
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getResponse() 0 9 1
1
<?php
2
3
namespace LE_ACME2\Request;
4
5
use LE_ACME2\Response;
6
7
use LE_ACME2\Connector\Connector;
8
use LE_ACME2\Exception;
9
10
class GetDirectory extends AbstractRequest {
11
12
    /**
13
     * @return Response\AbstractResponse|Response\GetDirectory
14
     * @throws Exception\InvalidResponse
15
     * @throws Exception\RateLimitReached
16
     */
17
    public function getResponse() : Response\AbstractResponse {
18
19
        $connector = Connector::getInstance();
20
21
        $result = $connector->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

21
        /** @scrutinizer ignore-call */ 
22
        $result = $connector->request(
Loading history...
22
            Connector::METHOD_GET,
23
             $connector->getBaseURL() . '/directory'
0 ignored issues
show
Bug introduced by
It seems like getBaseURL() 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

23
             $connector->/** @scrutinizer ignore-call */ 
24
                         getBaseURL() . '/directory'
Loading history...
24
        );
25
        return new Response\GetDirectory($result);
26
    }
27
}