| 1 | <?php namespace Bedard\Shop\Traits; |
||
| 7 | trait StartEndable |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Boot the startendable trait for this model. |
||
| 11 | * |
||
| 12 | * @return void |
||
| 13 | */ |
||
| 14 | public static function bootStartEndable() |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Ensure the start and end dates are valid. |
||
| 25 | * |
||
| 26 | * @return void |
||
| 27 | */ |
||
| 28 | public function validateStartEndDates() |
||
| 38 | } |
||
| 39 |
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: