| Conditions | 5 |
| Paths | 16 |
| Total Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 59 | 3 | public function run() |
|
| 60 | { |
||
| 61 | 3 | $params = []; |
|
| 62 | |||
| 63 | 3 | if ($this->issuer) { |
|
| 64 | 1 | $params['issuer'] = $this->issuer; |
|
| 65 | } |
||
| 66 | |||
| 67 | 3 | if ($this->label) { |
|
| 68 | 1 | $params['label'] = $this->label; |
|
| 69 | } |
||
| 70 | |||
| 71 | 3 | if ($this->image) { |
|
| 72 | 1 | $params['image'] = $this->image; |
|
| 73 | } |
||
| 74 | |||
| 75 | 3 | $uri = $this->user->getQrCodeUri($params); |
|
| 76 | |||
| 77 | 2 | if ($uri) { |
|
| 78 | 1 | return Html::img($uri, $this->options); |
|
| 79 | } else { |
||
| 80 | 1 | throw new InvalidCallException('Current user is guest, can not render qr code!'); |
|
| 81 | } |
||
| 82 | } |
||
| 83 | |||
| 85 |