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
![]() |
|||
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 |