Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
> **Note:** Please fill out all required sections and remove irrelevant ones.
> **Note:** Please fill out all relevant sections and remove irrelevant ones.
### 🔀 Purpose of this PR:

- [ ] Fixes a bug
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"require": {
"endroid/qr-code": "4.6.1"
"endroid/qr-code": "6.0.0"
}
}
64 changes: 32 additions & 32 deletions thirdparty/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions thirdparty/vendor/bacon/bacon-qr-code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,21 @@ BaconQrCode comes with multiple back ends for rendering images. Currently includ
- `ImagickImageBackEnd`: renders raster images using the Imagick library
- `SvgImageBackEnd`: renders SVG files using XMLWriter
- `EpsImageBackEnd`: renders EPS files

### GDLib Renderer
GD library has so many limitations, that GD support is not added as backend, but as separated renderer.
Use `GDLibRenderer` instead of `ImageRenderer`. These are the limitations:

- Does not support gradient.
- Does not support any curves, so you QR code is always squared.

Example usage:

```php
use BaconQrCode\Renderer\GDLibRenderer;
use BaconQrCode\Writer;

$renderer = new GDLibRenderer(400);
$writer = new Writer($renderer);
$writer->writeFile('Hello World!', 'qrcode.png');
```
20 changes: 13 additions & 7 deletions thirdparty/vendor/bacon/bacon-qr-code/composer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "bacon/bacon-qr-code",
"description": "BaconQrCode is a QR code generator for PHP.",
"license" : "BSD-2-Clause",
"license": "BSD-2-Clause",
"homepage": "https://github.com/Bacon/BaconQrCode",
"require": {
"php": "^7.1 || ^8.0",
"php": "^8.1",
"ext-iconv": "*",
"dasprid/enum": "^1.0.3"
},
Expand All @@ -24,15 +24,21 @@
"BaconQrCode\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"BaconQrCodeTest\\": "test/"
}
},
"require-dev": {
"phpunit/phpunit": "^7 | ^8 | ^9",
"spatie/phpunit-snapshot-assertions": "^4.2.9",
"squizlabs/php_codesniffer": "^3.4",
"phly/keep-a-changelog": "^2.1"
"phpunit/phpunit": "^10.5.11 || 11.0.4",
"spatie/phpunit-snapshot-assertions": "^5.1.5",
"squizlabs/php_codesniffer": "^3.9",
"phly/keep-a-changelog": "^2.12"
},
"config": {
"allow-plugins": {
"ocramius/package-versions": true
"ocramius/package-versions": true,
"php-http/discovery": true
}
},
"archive": {
Expand Down
13 changes: 0 additions & 13 deletions thirdparty/vendor/bacon/bacon-qr-code/phpunit.xml.dist

This file was deleted.

16 changes: 4 additions & 12 deletions thirdparty/vendor/bacon/bacon-qr-code/src/Common/BitArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,13 @@ final class BitArray
*
* @var SplFixedArray<int>
*/
private $bits;

/**
* Size of the bit array in bits.
*
* @var int
*/
private $size;
private SplFixedArray $bits;

/**
* Creates a new bit array with a given size.
*/
public function __construct(int $size = 0)
public function __construct(private int $size = 0)
{
$this->size = $size;
$this->bits = SplFixedArray::fromArray(array_fill(0, ($this->size + 31) >> 3, 0));
}

Expand Down Expand Up @@ -107,7 +99,7 @@ public function getNextSet(int $from) : int
}

$result = ($bitsOffset << 5) + BitUtils::numberOfTrailingZeros($currentBits);
return $result > $this->size ? $this->size : $result;
return min($result, $this->size);
}

/**
Expand All @@ -133,7 +125,7 @@ public function getNextUnset(int $from) : int
}

$result = ($bitsOffset << 5) + BitUtils::numberOfTrailingZeros($currentBits);
return $result > $this->size ? $this->size : $result;
return min($result, $this->size);
}

/**
Expand Down
18 changes: 6 additions & 12 deletions thirdparty/vendor/bacon/bacon-qr-code/src/Common/BitMatrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,30 @@ class BitMatrix
{
/**
* Width of the bit matrix.
*
* @var int
*/
private $width;
private int $width;

/**
* Height of the bit matrix.
*
* @var int
*/
private $height;
private ?int $height;

/**
* Size in bits of each individual row.
*
* @var int
*/
private $rowSize;
private int $rowSize;

/**
* Bits representation.
*
* @var SplFixedArray<int>
*/
private $bits;
private SplFixedArray $bits;

/**
* @throws InvalidArgumentException if a dimension is smaller than zero
*/
public function __construct(int $width, int $height = null)
public function __construct(int $width, ?int $height = null)
{
if (null === $height) {
$height = $width;
Expand Down Expand Up @@ -138,7 +132,7 @@ public function setRegion(int $left, int $top, int $width, int $height) : void
/**
* A fast method to retrieve one row of data from the matrix as a BitArray.
*/
public function getRow(int $y, BitArray $row = null) : BitArray
public function getRow(int $y, ?BitArray $row = null) : BitArray
{
if (null === $row || $row->getSize() < $this->width) {
$row = new BitArray($this->width);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,32 +69,26 @@ final class CharacterSetEci extends AbstractEnum
protected const GB18030 = [[29], 'GB2312', 'EUC_CN', 'GBK'];
protected const EUC_KR = [[30], 'EUC-KR'];

/**
* @var int[]
*/
private $values;

/**
* @var string[]
*/
private $otherEncodingNames;
private array $otherEncodingNames;

/**
* @var array<int, self>|null
*/
private static $valueToEci;
private static ?array $valueToEci;

/**
* @var array<string, self>|null
*/
private static $nameToEci;
private static ?array $nameToEci = null;

/**
* @param int[] $values
*/
public function __construct(array $values, string ...$otherEncodingNames)
public function __construct(private readonly array $values, string ...$otherEncodingNames)
{
$this->values = $values;
$this->otherEncodingNames = $otherEncodingNames;
}

Expand Down
18 changes: 1 addition & 17 deletions thirdparty/vendor/bacon/bacon-qr-code/src/Common/EcBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,8 @@
*/
final class EcBlock
{
/**
* How many times the block is used.
*
* @var int
*/
private $count;

/**
* Number of data codewords.
*
* @var int
*/
private $dataCodewords;

public function __construct(int $count, int $dataCodewords)
public function __construct(private readonly int $count, private readonly int $dataCodewords)
{
$this->count = $count;
$this->dataCodewords = $dataCodewords;
}

/**
Expand Down
Loading