| Conditions | 3 |
| Paths | 2 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | public function run() |
||
| 44 | { |
||
| 45 | $text = call_user_func([Yii::$app->request, $this->method], $this->param, $this->text); |
||
| 46 | |||
| 47 | $qr = Yii::$app->get($this->component); |
||
| 48 | |||
| 49 | if ($text && $qr instanceof QrCodeComponent) { |
||
| 50 | Yii::$app->response->format = Response::FORMAT_RAW; |
||
| 51 | Yii::$app->response->headers->add('Content-Type', $qr->getContentType()); |
||
| 52 | |||
| 53 | return $qr->setText((string)$text)->writeString(); |
||
| 54 | } |
||
| 55 | } |
||
| 56 | } |
||
| 57 |