Completed
Push — master ( 128ddb...c5783a )
by
unknown
14s queued 10s
created

Fetcher::setURL()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace SilverStripe\EnvironmentCheck\Traits;
4
5
use SilverStripe\Control\Director;
6
7
/**
8
 * Simple helper for env checks which require HTTP clients.
9
 *
10
 * @package environmentcheck
11
 */
12
trait Fetcher
13
{
14
    /**
15
     * Client for making requests, set vi Injector.
16
     *
17
     * @see SilverStripe\EnvironmentCheck\Services
18
     *
19
     * @var GuzzleHttp\Client
0 ignored issues
show
Bug introduced by
The type SilverStripe\Environment...raits\GuzzleHttp\Client was not found. Did you mean GuzzleHttp\Client? If so, make sure to prefix the type with \.
Loading history...
20
     */
21
    public $client = null;
22
23
    /**
24
     * Absolute URL for requests.
25
     *
26
     * @var string
27
     */
28
    protected $url;
29
30
    /**
31
     * Set URL for requests.
32
     *
33
     * @param string $url Relative URL
34
     * @return self
35
     */
36
    public function setURL($url)
37
    {
38
        $this->url = Director::absoluteURL($url);
39
        return $this;
40
    }
41
42
    /**
43
     * Getter for URL
44
     *
45
     * @return string
46
     */
47
    public function getURL()
48
    {
49
        return $this->url;
50
    }
51
}
52