| 1 | <?php |
||
| 5 | class ResolveDataArgs |
||
| 6 | { |
||
| 7 | public $data; |
||
| 8 | public $context; |
||
| 9 | private $resolve_data; |
||
| 10 | |||
| 11 | public function __construct(array $data, array $context, $resolve_data) { |
||
| 16 | |||
| 17 | public function withData($data) { |
||
| 20 | |||
| 21 | public function withContext(array $context) { |
||
| 24 | |||
| 25 | public function resolveData($data = null, array $context = []) { |
||
| 28 | } |
||
| 29 |
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: