Passed
Push — master ( e59495...facc33 )
by Isaac
02:07
created

ContractsRequest::options()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 3
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 3
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Mediumart\Orange\SMS\Http\Requests;
4
5
use Mediumart\Orange\SMS\Http\SMSClientRequest;
6
7
class ContractsRequest extends SMSClientRequest
8
{
9
    /**
10
     * International country code.
11
     *
12
     * @see http://fr.wikipedia.org/wiki/ISO_3166-1#Table_de_codage
13
     * @var string
14
     */
15
    protected $countryCode;
16
17
    /**
18
     * ContractsRequest constructor.
19
     * @param null $countryCode
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $countryCode is correct as it would always require null to be passed?
Loading history...
20
     */
21 1
    public function __construct($countryCode = null)
22
    {
23 1
        $this->countryCode = $countryCode;
24 1
    }
25
26
    /**
27
     * @inherit
28
     *
29
     * @return string
30
     */
31 1
    public function method()
32
    {
33 1
        return 'GET';
34
    }
35
36
    /**
37
     * @inherit
38
     *
39
     * @return string
40
     */
41 1
    public function uri()
42
    {
43 1
        $uri = static::BASE_URI . '/sms/admin/v1/contracts';
44
45 1
        return $this->countryCode ? $uri.'?country='.$this->countryCode : $uri;
46
    }
47
}
48