| Conditions | 1 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 10 |
| Ratio | 100 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 2 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php namespace Distilleries\Expendable\Models; |
||
| 39 | View Code Duplication | public function lock() |
|
| 40 | { |
||
| 41 | $this->{$this->column_nb_of_try_name} = config($this->config_key_security_lock) + 1; |
||
| 42 | |||
| 43 | \DB::table($this->getTable()) |
||
| 44 | ->where($this->getKeyName(),$this->getKey()) |
||
| 45 | ->increment($this->column_nb_of_try_name,$this->{$this->column_nb_of_try_name} ); |
||
| 46 | |||
| 47 | return $this; |
||
| 48 | } |
||
| 49 | |||
| 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.