1 | <?php |
||
8 | trait InteractsWithConnection |
||
9 | { |
||
10 | /** |
||
11 | * The connection credentials. |
||
12 | * |
||
13 | * @var \NotificationChannels\Apn\ApnCredentials |
||
14 | */ |
||
15 | protected $credentials; |
||
16 | |||
17 | /** |
||
18 | * Open the connection to the feedback service. |
||
19 | * |
||
20 | * @return void |
||
21 | * @throws \NotificationChannels\Apn\Exception\ConnectionFailed |
||
22 | */ |
||
23 | 3 | protected function openConnection() |
|
35 | |||
36 | /** |
||
37 | * Close the connection. |
||
38 | * |
||
39 | * @return void |
||
40 | */ |
||
41 | 3 | protected function closeConnection() |
|
45 | } |
||
46 |
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: