| Conditions | 2 |
| Paths | 2 |
| Total Lines | 25 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | 4 | public function updateCustomerFav($custID) |
|
| 26 | { |
||
| 27 | 4 | $favData = CustomerFavs::where('cust_id', $custID)->where('user_id', $this->userID)->first(); |
|
| 28 | |||
| 29 | 4 | if($favData) |
|
| 30 | { |
||
| 31 | 2 | Log::info('Customer Bookmark removed. Detais', [ |
|
| 32 | 2 | 'user_id' => $this->userID, |
|
| 33 | 2 | 'cust_id' => $custID, |
|
| 34 | ]); |
||
| 35 | 2 | $favData->delete(); |
|
| 36 | } |
||
| 37 | else |
||
| 38 | { |
||
| 39 | 4 | CustomerFavs::create([ |
|
| 40 | 4 | 'user_id' => $this->userID, |
|
| 41 | 4 | 'cust_id' => $custID, |
|
| 42 | ]); |
||
| 43 | 4 | Log::info('Customer Bookmark added. Detais', [ |
|
| 44 | 4 | 'user_id' => $this->userID, |
|
| 45 | 4 | 'cust_id' => $custID, |
|
| 46 | ]); |
||
| 47 | } |
||
| 48 | |||
| 49 | 4 | return true; |
|
| 50 | } |
||
| 52 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.