| 1 | <?php declare(strict_types=1); |
||
| 5 | class Environment |
||
| 6 | { |
||
| 7 | protected $merchant; |
||
| 8 | protected $merchantUser; |
||
| 9 | protected $merchantPassword; |
||
| 10 | |||
| 11 | public function __construct(string $apiUrl, string $merchant, string $merchantUser, string $merchantPassword) |
||
| 18 | |||
| 19 | public function getUrl() |
||
| 23 | |||
| 24 | public function getMerchantData() |
||
| 32 | } |
||
| 33 |
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: