mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-30 20:17:17 +00:00
:octocat: remove QROptionsTrait::$svgWidth and QROptionsTrait::$svgHeight as they can now be easily set in QRMarkupSVG::header() if necessary
This commit is contained in:
@@ -87,11 +87,9 @@ printf('<img alt="%s" src="%s" />', $alt, $out);
|
||||
| `$outputBase64` | `bool` |
|
||||
| `$svgAddXmlHeader` | `bool` |
|
||||
| `$svgDefs` | `string` |
|
||||
| `$svgHeight` | `string\|null` |
|
||||
| `$svgOpacity` | `float` |
|
||||
| `$svgPreserveAspectRatio` | `string` |
|
||||
| `$svgViewBoxSize` | `int\|null` |
|
||||
| `$svgWidth` | `string\|null` |
|
||||
|
||||
|
||||
### Options that have no effect
|
||||
|
||||
@@ -73,17 +73,12 @@ class QRMarkupSVG extends QRMarkup{
|
||||
* returns the <svg> header with the given options parsed
|
||||
*/
|
||||
protected function header():string{
|
||||
$width = ($this->options->svgWidth !== null) ? sprintf(' width="%s"', $this->options->svgWidth) : '';
|
||||
$height = ($this->options->svgHeight !== null) ? sprintf(' height="%s"', $this->options->svgHeight) : '';
|
||||
|
||||
/** @noinspection HtmlUnknownAttribute */
|
||||
$header = sprintf(
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" class="qr-svg %1$s" viewBox="0 0 %2$s %2$s" preserveAspectRatio="%3$s"%4$s%5$s>%6$s',
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" class="qr-svg %1$s" viewBox="%2$s" preserveAspectRatio="%3$s">%4$s',
|
||||
$this->options->cssClass,
|
||||
($this->options->svgViewBoxSize ?? $this->moduleCount),
|
||||
$this->options->svgPreserveAspectRatio,
|
||||
$width,
|
||||
$height,
|
||||
$this->options->eol
|
||||
);
|
||||
|
||||
|
||||
@@ -351,20 +351,6 @@ trait QROptionsTrait{
|
||||
*/
|
||||
protected string $svgPreserveAspectRatio = 'xMidYMid';
|
||||
|
||||
/**
|
||||
* Optional "width" attribute with the specified value (note that the value is not checked!)
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/width
|
||||
*/
|
||||
protected ?string $svgWidth = null;
|
||||
|
||||
/**
|
||||
* Optional "height" attribute with the specified value (note that the value is not checked!)
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/height
|
||||
*/
|
||||
protected ?string $svgHeight = null;
|
||||
|
||||
|
||||
/*
|
||||
* QRString settings
|
||||
|
||||
Reference in New Issue
Block a user