| Conditions | 2 |
| Paths | 2 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function run() |
||
| 14 | { |
||
| 15 | $link = Link::where('url', '=', 'Link')->take(1)->get(); |
||
| 16 | $admin = Link::where('url', '=', 'Admin')->take(1)->get(); |
||
|
|
|||
| 17 | if ( isset($link) ){ |
||
| 18 | Link::where('url', '=', 'Link')->update(['main' => true]); |
||
| 19 | Link::where('url', '=', 'Admin')->update(['main' => true]); |
||
| 20 | } else { |
||
| 21 | Serverfireteam\Panel\Link::create(array( |
||
| 22 | 'display' => 'Links', |
||
| 23 | 'url' => 'Link', |
||
| 24 | 'main' => true, |
||
| 25 | 'show_menu' => true |
||
| 26 | )); |
||
| 27 | Serverfireteam\Panel\Link::create(array( |
||
| 28 | 'display' => 'Admins', |
||
| 29 | 'url' => 'Admin', |
||
| 30 | 'main' => true, |
||
| 31 | 'show_menu' => true |
||
| 32 | )); |
||
| 33 | } |
||
| 34 | } |
||
| 35 | |||
| 37 |
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.