| 1 | <?php |
||
| 8 | trait InteractsWithConnection |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * The connection environment. |
||
| 12 | * |
||
| 13 | * @var int |
||
| 14 | */ |
||
| 15 | protected $environment; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * The connection certificate. |
||
| 19 | * |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | protected $certificate; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * The connection pass phrase. |
||
| 26 | * |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | protected $passPhrase; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Open the connection to the feedback service. |
||
| 33 | * |
||
| 34 | * @return void |
||
| 35 | * @throws \NotificationChannels\Apn\Exception\ConnectionFailed |
||
| 36 | */ |
||
| 37 | 3 | protected function openConnection() |
|
| 45 | |||
| 46 | /** |
||
| 47 | * Close the connection. |
||
| 48 | * |
||
| 49 | * @return void |
||
| 50 | */ |
||
| 51 | 2 | protected function closeConnection() |
|
| 55 | } |
||
| 56 |
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: