1 | <?php |
||
10 | class Record extends Model |
||
11 | { |
||
12 | protected $table = 'records'; |
||
13 | |||
14 | public $primaryKey = 'id'; |
||
15 | |||
16 | public $guarded = ['id']; |
||
17 | |||
18 | public $timestamps = true; |
||
19 | |||
20 | protected $dates = [ |
||
21 | 'time_from', |
||
22 | 'time_to', |
||
23 | ]; |
||
24 | |||
25 | protected $appends = [ |
||
26 | 'hours', |
||
27 | ]; |
||
28 | |||
29 | /** |
||
30 | * The "booted" method of the model. |
||
31 | * |
||
32 | * @return void |
||
33 | */ |
||
34 | protected static function booted() |
||
45 | |||
46 | public function recordable() : MorphTo |
||
50 | |||
51 | public function getHoursAttribute() : float |
||
61 | |||
62 | public function hours($rounded_up = false) |
||
74 | } |
||
75 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.