| Conditions | 3 |
| Paths | 4 |
| Total Lines | 24 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 15 | public function __construct(Builder $builder, EntityInterface $related, SearchQuery $search = null) |
||
| 16 | { |
||
| 17 | $this->datalistAllowed = false; |
||
| 18 | |||
| 19 | $this->input = new Elements\Select(); |
||
| 20 | |||
| 21 | $this->input[''] = ''; |
||
| 22 | |||
| 23 | if ($search === null) { |
||
| 24 | $search = new SearchQuery(); |
||
|
|
|||
| 25 | } |
||
| 26 | |||
| 27 | foreach ($related->search() as $id => $row) { |
||
| 28 | $this->input[$id] = $related->getLabel($id, $row); |
||
| 29 | } |
||
| 30 | |||
| 31 | parent::__construct(); |
||
| 32 | |||
| 33 | $this->set([ |
||
| 34 | 'list' => false, |
||
| 35 | 'class' => 'is-responsive', |
||
| 36 | 'module' => 'entity-select', |
||
| 37 | ]); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |
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.