| Conditions | 4 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace Bedard\Shop\Traits; |
||
| 28 | public function validateStartEndDates() |
||
| 29 | { |
||
| 30 | // Start date must be after the end date |
||
| 31 | if ($this->start_at !== null && |
||
|
|
|||
| 32 | $this->end_at !== null && |
||
| 33 | $this->start_at >= $this->end_at) { |
||
| 34 | Flash::error(Lang::get('bedard.shop::lang.traits.startendable.start_at_invalid')); |
||
| 35 | throw new ModelException($this); |
||
| 36 | } |
||
| 37 | } |
||
| 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: