Test Failed
Pull Request — master (#13)
by
unknown
04:04
created

Search::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Digitonic\IexCloudSdk\ReferenceData;
4
5
use Digitonic\IexCloudSdk\Contracts\IEXCloud;
6
use Digitonic\IexCloudSdk\Requests\BaseRequest;
7
8
class Search extends BaseRequest
9
{
10
    const ENDPOINT = 'search/{term}';
11
12
    /**
13
     * @var string
14
     */
15
    protected $term;
16
17
    /**
18
     * Create constructor.
19
     *
20
     * @param  IEXCloud  $api
21
     */
22 1
    public function __construct(IEXCloud $api)
23
    {
24 1
        parent::__construct($api);
25 1
    }
26
27
    /**
28
     * @param  string  $term
29
30
     *
31
     * @return Search
32
     */
33
    public function setTerm(string $term): self
34
    {
35
        $this->term = $term;
36
37
        return $this;
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    protected function getFullEndpoint(): string
44
    {
45
        return str_replace('{term}', $this->term, self::ENDPOINT);
46
    }
47
}
48