| Conditions | 5 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | public function getValue() |
||
| 13 | { |
||
| 14 | $value = $this->getValueFromModel(); |
||
| 15 | if (empty($value)) { |
||
| 16 | return $value; |
||
| 17 | } |
||
| 18 | |||
| 19 | if ($this->isOptionsModel() && $this->isRelation()) { |
||
| 20 | $model = $this->getOptionsModel(); |
||
| 21 | $key = $this->getOptionsValueAttribute() ?: $model->getKeyName(); |
||
| 22 | |||
| 23 | $value = $value->pluck($key)->map(function ($item) { |
||
| 24 | return (string)$item; |
||
| 25 | }); |
||
| 26 | } |
||
| 27 | return $value; |
||
| 28 | } |
||
| 29 | |||
| 64 |
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.