Skip to content

Commit 13e9246

Browse files
committed
Update endroid/qr-code to 6.0.9
1 parent 7e17cf3 commit 13e9246

File tree

145 files changed

+1696
-3775
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+1696
-3775
lines changed

compose.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
services:
2+
webserver:
3+
image: localhost/block-qrcode:5
4+
depends_on:
5+
- db
6+
volumes:
7+
- ".:/var/www/html/blocks/qrcode"
8+
environment:
9+
MOODLE_DOCKER_RUNNING: 1
10+
MOODLE_DOCKER_DBTYPE: pgsql
11+
MOODLE_DOCKER_DBNAME: moodle
12+
MOODLE_DOCKER_DBUSER: moodle
13+
MOODLE_DOCKER_DBPASS: "m@0dl3ing"
14+
MOODLE_DOCKER_BROWSER: firefox
15+
MOODLE_DOCKER_WEB_HOST: "${MOODLE_DOCKER_WEB_HOST}"
16+
MOODLE_DOCKER_WEB_PORT: "33333"
17+
MOODLE_DOCKER_TIMEOUT_FACTOR: "${MOODLE_DOCKER_TIMEOUT_FACTOR}"
18+
ports:
19+
- "33333:80"
20+
db:
21+
image: postgres:${MOODLE_DOCKER_DB_VERSION:-14}
22+
environment:
23+
POSTGRES_USER: moodle
24+
POSTGRES_PASSWORD: "m@0dl3ing"
25+
POSTGRES_DB: moodle

thirdparty/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"require": {
3-
"endroid/qr-code": "4.6.1"
3+
"endroid/qr-code": "^6.0.0"
44
}
55
}

thirdparty/composer.lock

Lines changed: 32 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

thirdparty/vendor/bacon/bacon-qr-code/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,21 @@ BaconQrCode comes with multiple back ends for rendering images. Currently includ
3737
- `ImagickImageBackEnd`: renders raster images using the Imagick library
3838
- `SvgImageBackEnd`: renders SVG files using XMLWriter
3939
- `EpsImageBackEnd`: renders EPS files
40+
41+
### GDLib Renderer
42+
GD library has so many limitations, that GD support is not added as backend, but as separated renderer.
43+
Use `GDLibRenderer` instead of `ImageRenderer`. These are the limitations:
44+
45+
- Does not support gradient.
46+
- Does not support any curves, so you QR code is always squared.
47+
48+
Example usage:
49+
50+
```php
51+
use BaconQrCode\Renderer\GDLibRenderer;
52+
use BaconQrCode\Writer;
53+
54+
$renderer = new GDLibRenderer(400);
55+
$writer = new Writer($renderer);
56+
$writer->writeFile('Hello World!', 'qrcode.png');
57+
```

thirdparty/vendor/bacon/bacon-qr-code/composer.json

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "bacon/bacon-qr-code",
33
"description": "BaconQrCode is a QR code generator for PHP.",
4-
"license" : "BSD-2-Clause",
4+
"license": "BSD-2-Clause",
55
"homepage": "https://github.com/Bacon/BaconQrCode",
66
"require": {
7-
"php": "^7.1 || ^8.0",
7+
"php": "^8.1",
88
"ext-iconv": "*",
99
"dasprid/enum": "^1.0.3"
1010
},
@@ -24,15 +24,21 @@
2424
"BaconQrCode\\": "src/"
2525
}
2626
},
27+
"autoload-dev": {
28+
"psr-4": {
29+
"BaconQrCodeTest\\": "test/"
30+
}
31+
},
2732
"require-dev": {
28-
"phpunit/phpunit": "^7 | ^8 | ^9",
29-
"spatie/phpunit-snapshot-assertions": "^4.2.9",
30-
"squizlabs/php_codesniffer": "^3.4",
31-
"phly/keep-a-changelog": "^2.1"
33+
"phpunit/phpunit": "^10.5.11 || 11.0.4",
34+
"spatie/phpunit-snapshot-assertions": "^5.1.5",
35+
"squizlabs/php_codesniffer": "^3.9",
36+
"phly/keep-a-changelog": "^2.12"
3237
},
3338
"config": {
3439
"allow-plugins": {
35-
"ocramius/package-versions": true
40+
"ocramius/package-versions": true,
41+
"php-http/discovery": true
3642
}
3743
},
3844
"archive": {

thirdparty/vendor/bacon/bacon-qr-code/phpunit.xml.dist

Lines changed: 0 additions & 13 deletions
This file was deleted.

thirdparty/vendor/bacon/bacon-qr-code/src/Common/BitArray.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,13 @@ final class BitArray
1616
*
1717
* @var SplFixedArray<int>
1818
*/
19-
private $bits;
20-
21-
/**
22-
* Size of the bit array in bits.
23-
*
24-
* @var int
25-
*/
26-
private $size;
19+
private SplFixedArray $bits;
2720

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

@@ -107,7 +99,7 @@ public function getNextSet(int $from) : int
10799
}
108100

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

113105
/**
@@ -133,7 +125,7 @@ public function getNextUnset(int $from) : int
133125
}
134126

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

139131
/**

thirdparty/vendor/bacon/bacon-qr-code/src/Common/BitMatrix.php

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,30 @@ class BitMatrix
1717
{
1818
/**
1919
* Width of the bit matrix.
20-
*
21-
* @var int
2220
*/
23-
private $width;
21+
private int $width;
2422

2523
/**
2624
* Height of the bit matrix.
27-
*
28-
* @var int
2925
*/
30-
private $height;
26+
private ?int $height;
3127

3228
/**
3329
* Size in bits of each individual row.
34-
*
35-
* @var int
3630
*/
37-
private $rowSize;
31+
private int $rowSize;
3832

3933
/**
4034
* Bits representation.
4135
*
4236
* @var SplFixedArray<int>
4337
*/
44-
private $bits;
38+
private SplFixedArray $bits;
4539

4640
/**
4741
* @throws InvalidArgumentException if a dimension is smaller than zero
4842
*/
49-
public function __construct(int $width, int $height = null)
43+
public function __construct(int $width, ?int $height = null)
5044
{
5145
if (null === $height) {
5246
$height = $width;
@@ -138,7 +132,7 @@ public function setRegion(int $left, int $top, int $width, int $height) : void
138132
/**
139133
* A fast method to retrieve one row of data from the matrix as a BitArray.
140134
*/
141-
public function getRow(int $y, BitArray $row = null) : BitArray
135+
public function getRow(int $y, ?BitArray $row = null) : BitArray
142136
{
143137
if (null === $row || $row->getSize() < $this->width) {
144138
$row = new BitArray($this->width);

thirdparty/vendor/bacon/bacon-qr-code/src/Common/CharacterSetEci.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,32 +69,26 @@ final class CharacterSetEci extends AbstractEnum
6969
protected const GB18030 = [[29], 'GB2312', 'EUC_CN', 'GBK'];
7070
protected const EUC_KR = [[30], 'EUC-KR'];
7171

72-
/**
73-
* @var int[]
74-
*/
75-
private $values;
76-
7772
/**
7873
* @var string[]
7974
*/
80-
private $otherEncodingNames;
75+
private array $otherEncodingNames;
8176

8277
/**
8378
* @var array<int, self>|null
8479
*/
85-
private static $valueToEci;
80+
private static ?array $valueToEci;
8681

8782
/**
8883
* @var array<string, self>|null
8984
*/
90-
private static $nameToEci;
85+
private static ?array $nameToEci = null;
9186

9287
/**
9388
* @param int[] $values
9489
*/
95-
public function __construct(array $values, string ...$otherEncodingNames)
90+
public function __construct(private readonly array $values, string ...$otherEncodingNames)
9691
{
97-
$this->values = $values;
9892
$this->otherEncodingNames = $otherEncodingNames;
9993
}
10094

0 commit comments

Comments
 (0)