Skip to content

Commit 7447269

Browse files
committed
Adapt to new endroid/qr-code API
1 parent d4b064f commit 7447269

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

classes/output_image.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,11 @@ public function create_image() {
164164
} else {
165165
$url = course_get_url($this->course)->out(false, ['utm_source' => 'block_qrcode']);
166166
}
167-
$qrcode = new QrCode($url);
168-
$qrcode->setSize($this->size);
169-
170-
// Set advanced options.
171-
$qrcode->setMargin(10);
172-
$qrcode->setEncoding(new Encoding('UTF-8'));
173-
$qrcode->setErrorCorrectionLevel(new ErrorCorrectionLevel\ErrorCorrectionLevelHigh());
174-
$qrcode->setForegroundColor(new Color(0, 0, 0));
175-
$qrcode->setBackgroundColor(new Color(255, 255, 255));
167+
$qrcode = new QrCode(
168+
data: $url,
169+
size: $this->size,
170+
errorCorrectionLevel: ErrorCorrectionLevel::High,
171+
);
176172

177173
// Png format.
178174
$logo = null;

0 commit comments

Comments
 (0)