first commit
This commit is contained in:
21
vendor/endroid/qr-code/src/Encoding/Encoding.php
vendored
Normal file
21
vendor/endroid/qr-code/src/Encoding/Encoding.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Endroid\QrCode\Encoding;
|
||||
|
||||
final class Encoding implements EncodingInterface
|
||||
{
|
||||
public function __construct(
|
||||
private string $value
|
||||
) {
|
||||
if (!in_array($value, mb_list_encodings())) {
|
||||
throw new \Exception(sprintf('Invalid encoding "%s"', $value));
|
||||
}
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
}
|
||||
10
vendor/endroid/qr-code/src/Encoding/EncodingInterface.php
vendored
Normal file
10
vendor/endroid/qr-code/src/Encoding/EncodingInterface.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Endroid\QrCode\Encoding;
|
||||
|
||||
interface EncodingInterface
|
||||
{
|
||||
public function __toString(): string;
|
||||
}
|
||||
Reference in New Issue
Block a user