| Conditions | 7 |
| Paths | 10 |
| Total Lines | 33 |
| Code Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public static function build( |
||
| 23 | BaseFindYmlInterface $class, |
||
| 24 | ActiveDataProvider $dataProvider = null, |
||
| 25 | ActiveQuery $query = null, |
||
| 26 | $findParams = [] |
||
| 27 | ) |
||
| 28 | { |
||
| 29 | if (!empty($dataProvider)) { |
||
| 30 | if ($dataProvider instanceof ActiveDataProvider) { |
||
| 31 | $reader = new DataProviderReader($dataProvider); |
||
| 32 | } elseif ($dataProvider === true) { |
||
| 33 | if (!$query) { |
||
| 34 | $query = $class::findYml($findParams); |
||
| 35 | } |
||
| 36 | $reader = new DataProviderReader( |
||
| 37 | new ActiveDataProvider([ |
||
| 38 | 'query' => $query, |
||
| 39 | 'pagination' => [ |
||
| 40 | 'pageSize' => 1000, |
||
| 41 | ] |
||
| 42 | ]) |
||
| 43 | ); |
||
| 44 | } else { |
||
| 45 | $dataProvider = null; |
||
|
|
|||
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 49 | if (empty($reader)) { |
||
| 50 | $reader = new QueryReader($query ? : $class::findYml($findParams)); |
||
| 51 | } |
||
| 52 | |||
| 53 | return $reader; |
||
| 54 | } |
||
| 55 | } |
||
| 56 |
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.