| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function update(Request $request) |
||
| 25 | { |
||
| 26 | $notifications = ''; |
||
|
|
|||
| 27 | LarametricsNotification::truncate(); |
||
| 28 | foreach(json_decode($request->input('notifications')) as $notification) { |
||
| 29 | $notificationData = array( |
||
| 30 | 'action' => $notification->action, |
||
| 31 | 'filter' => $notification->filter, |
||
| 32 | 'notify_by' => $notification->notify_by |
||
| 33 | ); |
||
| 34 | try { |
||
| 35 | LarametricsNotification::create($notificationData); |
||
| 36 | } catch(\Exception $e) { |
||
| 37 | } |
||
| 38 | } |
||
| 39 | |||
| 40 | return redirect()->route('rica.larametrics::notifications.index'); |
||
| 41 | } |
||
| 42 | |||
| 44 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.