qrcode.chapril.org-libreqr/vendor/endroid/qr-code/src/Encoding/Encoding.php

25 lines
465 B
PHP

<?php
declare(strict_types=1);
namespace Endroid\QrCode\Encoding;
final class Encoding implements EncodingInterface
{
private string $value;
public function __construct(string $value)
{
if (!in_array($value, mb_list_encodings())) {
throw new \Exception(sprintf('Invalid encoding "%s"', $value));
}
$this->value = $value;
}
public function __toString(): string
{
return $this->value;
}
}