1 | <?php |
||
8 | class Waredesk |
||
9 | { |
||
10 | const PRODUCTION_API_URL = 'https://api.waredesk.com'; |
||
11 | |||
12 | /** @var Variables */ |
||
13 | public $variables; |
||
14 | /** @var Products */ |
||
15 | public $products; |
||
16 | /** @var Inventory */ |
||
17 | public $inventory; |
||
18 | |||
19 | private $logger; |
||
20 | private $apiUrl; |
||
21 | private $requestHandler; |
||
22 | |||
23 | 20 | public function __construct(string $clientId, string $clientSecret, string $accessToken = null, LoggerInterface $logger = null) |
|
33 | |||
34 | public function getLogger(): ? LoggerInterface |
||
38 | |||
39 | 1 | public function setLogger(LoggerInterface $logger = null) |
|
44 | |||
45 | public function getApiUrl(): ? string |
||
49 | |||
50 | 20 | public function setApiUrl(string $apiUrl) |
|
55 | |||
56 | public function getClientId(): string |
||
60 | |||
61 | 1 | public function setClientId(string $clientId = null) |
|
65 | |||
66 | public function getClientSecret(): string |
||
70 | |||
71 | public function setClientSecret(string $clientSecret = null) |
||
75 | |||
76 | 2 | public function getAccessToken(): string |
|
80 | |||
81 | 20 | public function setAccessToken(string $accessToken = null) |
|
85 | |||
86 | 20 | public function setMockHandler(HandlerStack $mockHandler = null) |
|
90 | } |
||
91 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: