| Total Complexity | 8 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class Settings extends Model |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * The attributes that are mass assignable. |
||
| 11 | * |
||
| 12 | * @var array |
||
| 13 | */ |
||
| 14 | protected $fillable = [ |
||
| 15 | 'exchanges_start_at', |
||
| 16 | 'exchanges_end_at', |
||
| 17 | 'enrollments_start_at', |
||
| 18 | 'enrollments_end_at', |
||
| 19 | ]; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * The attributes that should be mutated to dates. |
||
| 23 | * |
||
| 24 | * @var array |
||
| 25 | */ |
||
| 26 | protected $dates = [ |
||
| 27 | 'created_at', |
||
| 28 | 'updated_at', |
||
| 29 | 'exchanges_start_at', |
||
| 30 | 'exchanges_end_at', |
||
| 31 | 'enrollments_start_at', |
||
| 32 | 'enrollments_end_at', |
||
| 33 | ]; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Checks whether today's date is within the shift exchanging period. |
||
| 37 | * |
||
| 38 | * @return bool |
||
| 39 | */ |
||
| 40 | public function withinExchangePeriod(): bool |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Checks whether today's date is within the course enrollment period. |
||
| 51 | * |
||
| 52 | * @return bool |
||
| 53 | */ |
||
| 54 | public function withinEnrollmentPeriod(): bool |
||
| 63 |
Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.