1 | <?php |
||
7 | trait SoftDeletes |
||
8 | { |
||
9 | use \Illuminate\Database\Eloquent\SoftDeletes; |
||
10 | |||
11 | /** |
||
12 | * Boot the soft deleting trait for a model. |
||
13 | * |
||
14 | * @return void |
||
15 | */ |
||
16 | public static function bootSoftDeletes() |
||
21 | |||
22 | /** |
||
23 | * @inheritdoc |
||
24 | */ |
||
25 | public function getQualifiedDeletedAtColumn() |
||
29 | |||
30 | /** |
||
31 | * Determine if the model instance has been soft-deleted. |
||
32 | * |
||
33 | * @return bool |
||
34 | */ |
||
35 | public function trashed() |
||
39 | |||
40 | } |
||
41 |
This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.
Unreachable code is most often the result of
return
,die
orexit
statements that have been added for debug purposes.In the above example, the last
return false
will never be executed, because a return statement has already been met in every possible execution path.