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 | private $apiUrl; |
||
22 | private $requestHandler; |
||
23 | |||
24 | 15 | public function __construct(string $clientId, string $clientSecret, string $accessToken = null) |
|
32 | |||
33 | public function getApiUrl() |
||
37 | |||
38 | 15 | public function setApiUrl($apiUrl) |
|
43 | |||
44 | public function getClientId(): string |
||
48 | |||
49 | 1 | public function setClientId(string $clientId = null) |
|
53 | |||
54 | public function getClientSecret(): string |
||
58 | |||
59 | public function setClientSecret(string $clientSecret = null) |
||
63 | |||
64 | 2 | public function getAccessToken(): string |
|
68 | |||
69 | 15 | public function setAccessToken(string $accessToken = null) |
|
73 | |||
74 | 15 | public function setMockHandler(HandlerStack $mockHandler = null) |
|
78 | } |
||
79 |
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: