Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
44 | public function run($id, string $ext) |
||
|
|||
45 | { |
||
46 | $this->checkAccess( |
||
47 | ($model = $this->findModel($id)), |
||
48 | Yii::$app->request->queryParams |
||
49 | ); |
||
50 | |||
51 | return Yii::$app->response->sendFile( |
||
52 | $model->filePath($ext), |
||
53 | $model->fileName($ext), |
||
54 | [ |
||
55 | 'mimeType' => $model->fileMimeType($ext), |
||
56 | 'inline' => !Yii::$app->request |
||
57 | ->getQueryParam($this->downloadParam, false), |
||
58 | ] |
||
59 | ); |
||
60 | } |
||
61 | } |
||
62 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@return
annotation as described here.