| Total Complexity | 12 |
| Total Lines | 74 |
| 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 | 'min_group_members', |
||
| 20 | 'max_group_members', |
||
| 21 | 'groups_start_at', |
||
| 22 | 'groups_end_at', |
||
| 23 | ]; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * The attributes that should be mutated to dates. |
||
| 27 | * |
||
| 28 | * @var array |
||
| 29 | */ |
||
| 30 | protected $dates = [ |
||
| 31 | 'created_at', |
||
| 32 | 'updated_at', |
||
| 33 | 'exchanges_start_at', |
||
| 34 | 'exchanges_end_at', |
||
| 35 | 'enrollments_start_at', |
||
| 36 | 'enrollments_end_at', |
||
| 37 | 'groups_start_at', |
||
| 38 | 'groups_end_at', |
||
| 39 | ]; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Checks whether today's date is within the shift exchanging period. |
||
| 43 | * |
||
| 44 | * @return bool |
||
| 45 | */ |
||
| 46 | public function withinExchangePeriod(): bool |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Checks whether today's date is within the course enrollment period. |
||
| 57 | * |
||
| 58 | * @return bool |
||
| 59 | */ |
||
| 60 | public function withinEnrollmentPeriod(): bool |
||
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * Checks whether today's date is within the groups formation period. |
||
| 71 | * |
||
| 72 | * @return bool |
||
| 73 | */ |
||
| 74 | public function withinGroupPeriod(): bool |
||
| 83 |