| Conditions | 4 |
| Paths | 4 |
| Total Lines | 26 |
| Code Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 48 | public function edit() |
||
| 49 | { |
||
| 50 | $operation = Input::get('oper'); |
||
| 51 | switch ($operation) { |
||
| 52 | case "add": |
||
| 53 | $this->course->name = Input::get('name'); |
||
| 54 | $this->course->par = Input::get('par'); |
||
| 55 | $this->course->rating = Input::get('rating'); |
||
| 56 | $this->course->slope = Input::get('slope'); |
||
| 57 | $this->course->save(); |
||
| 58 | break; |
||
| 59 | case "edit": |
||
| 60 | $id = Input::get('id'); |
||
| 61 | $this->course = $this->course->find($id); |
||
| 62 | $this->course->name = Input::get('name'); |
||
| 63 | $this->course->par = Input::get('par'); |
||
| 64 | $this->course->rating = Input::get('rating'); |
||
| 65 | $this->course->slope = Input::get('slope'); |
||
| 66 | $this->course->save(); |
||
| 67 | break; |
||
| 68 | case "del": |
||
| 69 | $id = Input::get('id'); |
||
| 70 | $this->course = $this->course->destroy($id); |
||
| 71 | break; |
||
| 72 | } |
||
| 73 | } |
||
| 74 | |||
| 97 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.