| Conditions | 4 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function getDataCellValue($model, $key, $index) |
||
| 35 | { |
||
| 36 | if (!$model->lastStats) { |
||
| 37 | return null; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** @var \app\components\Formatter $formatter */ |
||
| 41 | $formatter = $this->grid->formatter; |
||
| 42 | |||
| 43 | $lastChange = $model->lastChange($this->statsAttribute); |
||
| 44 | $monthlyChange = $model->monthlyChange($this->statsAttribute); |
||
| 45 | |||
| 46 | return sprintf( |
||
| 47 | "%s (%s/%s)", |
||
| 48 | $formatter->format($model->lastStats->{$this->statsAttribute}, $this->numberFormat), |
||
| 49 | $lastChange ? $formatter->asChange($lastChange, true, $this->numberFormat) : $lastChange, |
||
| 50 | $monthlyChange ? $formatter->asChange($monthlyChange, true, $this->numberFormat) : $monthlyChange |
||
| 51 | ); |
||
| 53 | } |