| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Class QRStringJSON |
| 5 |
* |
| 6 |
* @created 25.10.2023 |
| 7 |
* @author smiley <[email protected]> |
| 8 |
* @copyright 2023 smiley |
| 9 |
* @license MIT |
| 10 |
* |
| 11 |
* @noinspection PhpComposerExtensionStubsInspection |
| 12 |
*/ |
| 13 |
namespace WCPOS\Vendor\chillerlan\QRCode\Output; |
| 14 |
|
| 15 |
use function json_encode; |
| 16 |
/** |
| 17 |
* |
| 18 |
*/ |
| 19 |
class QRStringJSON extends QROutputAbstract |
| 20 |
{ |
| 21 |
public const MIME_TYPE = 'application/json'; |
| 22 |
/** |
| 23 |
* @inheritDoc |
| 24 |
* @throws \JsonException |
| 25 |
*/ |
| 26 |
public function dump(?string $file = null) : string |
| 27 |
{ |
| 28 |
$matrix = $this->matrix->getMatrix($this->options->jsonAsBooleans); |
| 29 |
$data = json_encode($matrix, $this->options->jsonFlags); |
| 30 |
$this->saveToFile($data, $file); |
| 31 |
return $data; |
| 32 |
} |
| 33 |
/** |
| 34 |
* unused - required by interface |
| 35 |
* |
| 36 |
* @inheritDoc |
| 37 |
* @codeCoverageIgnore |
| 38 |
*/ |
| 39 |
protected function prepareModuleValue($value) : string |
| 40 |
{ |
| 41 |
return ''; |
| 42 |
} |
| 43 |
/** |
| 44 |
* unused - required by interface |
| 45 |
* |
| 46 |
* @inheritDoc |
| 47 |
* @codeCoverageIgnore |
| 48 |
*/ |
| 49 |
protected function getDefaultModuleValue(bool $isDark) : string |
| 50 |
{ |
| 51 |
return ''; |
| 52 |
} |
| 53 |
/** |
| 54 |
* unused - required by interface |
| 55 |
* |
| 56 |
* @inheritDoc |
| 57 |
* @codeCoverageIgnore |
| 58 |
*/ |
| 59 |
public static function moduleValueIsValid($value) : bool |
| 60 |
{ |
| 61 |
return \true; |
| 62 |
} |
| 63 |
} |
| 64 |
|