| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 11 |
| Ratio | 100 % |
| Tests | 6 |
| CRAP Score | 1 |
| Changes | 2 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php namespace Distilleries\Expendable\Models; |
||
| 27 | 12 | View Code Duplication | public function unlock() |
| 28 | { |
||
| 29 | |||
| 30 | 12 | \DB::table($this->getTable()) |
|
| 31 | 12 | ->where($this->getKeyName(),$this->getKey()) |
|
| 32 | 12 | ->decrement($this->column_nb_of_try_name,$this->{$this->column_nb_of_try_name}); |
|
| 33 | |||
| 34 | 12 | $this->{$this->column_nb_of_try_name} = 0; |
|
| 35 | 12 | return $this; |
|
| 36 | |||
| 37 | } |
||
| 38 | |||
| 50 | } |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idableprovides a methodequalsIdthat in turn relies on the methodgetId(). If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()as an abstract method to the trait will make sure it is available.