1 | <?php |
||
7 | class Waredesk |
||
8 | { |
||
9 | const PRODUCTION_API_URL = 'https://api.waredesk.com'; |
||
10 | |||
11 | /** |
||
12 | * @var Codes |
||
13 | */ |
||
14 | public $codes; |
||
15 | |||
16 | /** |
||
17 | * @var Products |
||
18 | */ |
||
19 | public $products; |
||
20 | |||
21 | /** |
||
22 | * @var Inventory |
||
23 | */ |
||
24 | public $inventory; |
||
25 | |||
26 | private $apiUrl; |
||
27 | private $requestHandler; |
||
28 | |||
29 | 17 | public function __construct(string $clientId, string $clientSecret, string $accessToken = null) |
|
38 | |||
39 | public function getApiUrl() |
||
43 | |||
44 | 17 | public function setApiUrl($apiUrl) |
|
49 | |||
50 | public function getClientId(): string |
||
54 | |||
55 | 1 | public function setClientId(string $clientId = null) |
|
59 | |||
60 | public function getClientSecret(): string |
||
64 | |||
65 | public function setClientSecret(string $clientSecret = null) |
||
69 | |||
70 | 2 | public function getAccessToken(): string |
|
74 | |||
75 | 17 | public function setAccessToken(string $accessToken = null) |
|
79 | |||
80 | 17 | public function setMockHandler(HandlerStack $mockHandler = null) |
|
84 | } |
||
85 |
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: