1 | <?php |
||
5 | class SalesforceAuth |
||
6 | { |
||
7 | /** |
||
8 | * @var string |
||
9 | */ |
||
10 | public $id; |
||
11 | |||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | public $accessToken; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | public $instanceUrl; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | public $url; |
||
26 | |||
27 | /** |
||
28 | * @var bool |
||
29 | */ |
||
30 | private $authenticated = false; |
||
31 | |||
32 | public function isAuthenticated(): bool |
||
36 | |||
37 | public function __construct($client) |
||
43 | |||
44 | /** |
||
45 | * Login. |
||
46 | */ |
||
47 | private function login() |
||
72 | } |
||
73 |
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: