| Conditions | 4 |
| Paths | 3 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function renderValue(User $user) |
||
| 25 | { |
||
| 26 | $value = null; |
||
|
|
|||
| 27 | if (! $this->templateOverride && ! $this->craftProperty) { |
||
| 28 | return ''; |
||
| 29 | } |
||
| 30 | |||
| 31 | if ($this->templateOverride) { |
||
| 32 | $value = \Craft::$app->view->renderObjectTemplate( |
||
| 33 | $this->templateOverride, |
||
| 34 | $user |
||
| 35 | ); |
||
| 36 | } else { |
||
| 37 | $value = $user->{$this->craftProperty}; |
||
| 38 | } |
||
| 39 | |||
| 40 | return $value; |
||
| 41 | } |
||
| 42 | } |
||
| 43 |
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.