diff options
Diffstat (limited to 'vendor/chillerlan/php-qrcode/src/Output')
7 files changed, 40 insertions, 34 deletions
diff --git a/vendor/chillerlan/php-qrcode/src/Output/QRFpdf.php b/vendor/chillerlan/php-qrcode/src/Output/QRFpdf.php index a15ae9ff3..b8e6694e8 100644 --- a/vendor/chillerlan/php-qrcode/src/Output/QRFpdf.php +++ b/vendor/chillerlan/php-qrcode/src/Output/QRFpdf.php @@ -68,7 +68,7 @@ class QRFpdf extends QROutputAbstract{ * * @return string|\FPDF */ - public function dump(string $file = null){ + public function dump(?string $file = null){ $file ??= $this->options->cachefile; $fpdf = new FPDF('P', $this->options->fpdfMeasureUnit, [$this->length, $this->length]); diff --git a/vendor/chillerlan/php-qrcode/src/Output/QRImage.php b/vendor/chillerlan/php-qrcode/src/Output/QRImage.php index 8f533d341..c67c625b2 100644 --- a/vendor/chillerlan/php-qrcode/src/Output/QRImage.php +++ b/vendor/chillerlan/php-qrcode/src/Output/QRImage.php @@ -94,7 +94,7 @@ class QRImage extends QROutputAbstract{ * * @phan-suppress PhanUndeclaredTypeReturnType, PhanTypeMismatchReturn */ - public function dump(string $file = null){ + public function dump(?string $file = null){ $file ??= $this->options->cachefile; $this->image = imagecreatetruecolor($this->length, $this->length); diff --git a/vendor/chillerlan/php-qrcode/src/Output/QRImagick.php b/vendor/chillerlan/php-qrcode/src/Output/QRImagick.php index 49516d30e..ec0f6d5b0 100644 --- a/vendor/chillerlan/php-qrcode/src/Output/QRImagick.php +++ b/vendor/chillerlan/php-qrcode/src/Output/QRImagick.php @@ -67,7 +67,7 @@ class QRImagick extends QROutputAbstract{ * * @return string|\Imagick */ - public function dump(string $file = null){ + public function dump(?string $file = null){ $file ??= $this->options->cachefile; $this->imagick = new Imagick; diff --git a/vendor/chillerlan/php-qrcode/src/Output/QRMarkup.php b/vendor/chillerlan/php-qrcode/src/Output/QRMarkup.php index 06d6e88cb..1f7843182 100644 --- a/vendor/chillerlan/php-qrcode/src/Output/QRMarkup.php +++ b/vendor/chillerlan/php-qrcode/src/Output/QRMarkup.php @@ -53,7 +53,7 @@ class QRMarkup extends QROutputAbstract{ /** * HTML output */ - protected function html(string $file = null):string{ + protected function html(?string $file = null):string{ $html = empty($this->options->cssClass) ? '<div>' @@ -74,9 +74,11 @@ class QRMarkup extends QROutputAbstract{ $html .= '</div>'.$this->options->eol; if($file !== null){ - return '<!DOCTYPE html>'. - '<head><meta charset="UTF-8"><title>QR Code</title></head>'. - '<body>'.$this->options->eol.$html.'</body>'; + /** @noinspection HtmlRequiredLangAttribute */ + return sprintf( + '<!DOCTYPE html><html><head><meta charset="UTF-8"><title>QR Code</title></head><body>%s</body></html>', + $this->options->eol.$html + ); } return $html; @@ -87,7 +89,7 @@ class QRMarkup extends QROutputAbstract{ * * @see https://github.com/codemasher/php-qrcode/pull/5 */ - protected function svg(string $file = null):string{ + protected function svg(?string $file = null):string{ $matrix = $this->matrix->matrix(); $svg = sprintf($this->svgHeader, $this->options->cssClass, $this->options->svgViewBoxSize ?? $this->moduleCount) diff --git a/vendor/chillerlan/php-qrcode/src/Output/QROutputAbstract.php b/vendor/chillerlan/php-qrcode/src/Output/QROutputAbstract.php index d4ed3d0c9..78e761093 100644 --- a/vendor/chillerlan/php-qrcode/src/Output/QROutputAbstract.php +++ b/vendor/chillerlan/php-qrcode/src/Output/QROutputAbstract.php @@ -12,7 +12,8 @@ namespace chillerlan\QRCode\Output; -use chillerlan\QRCode\{Data\QRMatrix, QRCode}; +use chillerlan\QRCode\QRCode; +use chillerlan\QRCode\Data\QRMatrix; use chillerlan\Settings\SettingsContainerInterface; use function call_user_func_array, dirname, file_put_contents, get_called_class, in_array, is_writable, sprintf; @@ -112,7 +113,7 @@ abstract class QROutputAbstract implements QROutputInterface{ /** * @inheritDoc */ - public function dump(string $file = null){ + public function dump(?string $file = null){ $file ??= $this->options->cachefile; // call the built-in output method with the optional file path as parameter diff --git a/vendor/chillerlan/php-qrcode/src/Output/QROutputInterface.php b/vendor/chillerlan/php-qrcode/src/Output/QROutputInterface.php index b07b8e7a5..7052701b9 100644 --- a/vendor/chillerlan/php-qrcode/src/Output/QROutputInterface.php +++ b/vendor/chillerlan/php-qrcode/src/Output/QROutputInterface.php @@ -19,29 +19,32 @@ use chillerlan\QRCode\Data\QRMatrix; */ interface QROutputInterface{ - const DEFAULT_MODULE_VALUES = [ + public const DEFAULT_MODULE_VALUES = [ // light - QRMatrix::M_NULL => false, // 0 - QRMatrix::M_DATA => false, // 4 - QRMatrix::M_FINDER => false, // 6 - QRMatrix::M_SEPARATOR => false, // 8 - QRMatrix::M_ALIGNMENT => false, // 10 - QRMatrix::M_TIMING => false, // 12 - QRMatrix::M_FORMAT => false, // 14 - QRMatrix::M_VERSION => false, // 16 - QRMatrix::M_QUIETZONE => false, // 18 - QRMatrix::M_LOGO => false, // 20 - QRMatrix::M_TEST => false, // 255 + QRMatrix::M_NULL => false, + QRMatrix::M_DARKMODULE_LIGHT => false, + QRMatrix::M_DATA => false, + QRMatrix::M_FINDER => false, + QRMatrix::M_SEPARATOR => false, + QRMatrix::M_ALIGNMENT => false, + QRMatrix::M_TIMING => false, + QRMatrix::M_FORMAT => false, + QRMatrix::M_VERSION => false, + QRMatrix::M_QUIETZONE => false, + QRMatrix::M_LOGO => false, + QRMatrix::M_FINDER_DOT_LIGHT => false, // dark - QRMatrix::M_DARKMODULE << 8 => true, // 512 - QRMatrix::M_DATA << 8 => true, // 1024 - QRMatrix::M_FINDER << 8 => true, // 1536 - QRMatrix::M_ALIGNMENT << 8 => true, // 2560 - QRMatrix::M_TIMING << 8 => true, // 3072 - QRMatrix::M_FORMAT << 8 => true, // 3584 - QRMatrix::M_VERSION << 8 => true, // 4096 - QRMatrix::M_FINDER_DOT << 8 => true, // 5632 - QRMatrix::M_TEST << 8 => true, // 65280 + QRMatrix::M_DARKMODULE => true, + QRMatrix::M_DATA_DARK => true, + QRMatrix::M_FINDER_DARK => true, + QRMatrix::M_SEPARATOR_DARK => true, + QRMatrix::M_ALIGNMENT_DARK => true, + QRMatrix::M_TIMING_DARK => true, + QRMatrix::M_FORMAT_DARK => true, + QRMatrix::M_VERSION_DARK => true, + QRMatrix::M_QUIETZONE_DARK => true, + QRMatrix::M_LOGO_DARK => true, + QRMatrix::M_FINDER_DOT => true, ]; /** @@ -49,6 +52,6 @@ interface QROutputInterface{ * * @return mixed */ - public function dump(string $file = null); + public function dump(?string $file = null); } diff --git a/vendor/chillerlan/php-qrcode/src/Output/QRString.php b/vendor/chillerlan/php-qrcode/src/Output/QRString.php index 3ed5153e1..441ef99fd 100644 --- a/vendor/chillerlan/php-qrcode/src/Output/QRString.php +++ b/vendor/chillerlan/php-qrcode/src/Output/QRString.php @@ -50,7 +50,7 @@ class QRString extends QROutputAbstract{ /** * string output */ - protected function text(string $file = null):string{ + protected function text(?string $file = null):string{ $str = []; foreach($this->matrix->matrix() as $row){ @@ -69,7 +69,7 @@ class QRString extends QROutputAbstract{ /** * JSON output */ - protected function json(string $file = null):string{ + protected function json(?string $file = null):string{ return json_encode($this->matrix->matrix()); } |