Skip to content

Commit

Permalink
updated qr-code dependency for 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Tareq-Adnan committed Jan 10, 2025
1 parent 3df00d3 commit ffc8d3c
Show file tree
Hide file tree
Showing 48 changed files with 608 additions and 289 deletions.
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": "^6.0"
"endroid/qr-code": "^5.1"
}
}
24 changes: 12 additions & 12 deletions thirdparty/composer.lock

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

18 changes: 9 additions & 9 deletions thirdparty/vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,22 +112,22 @@
},
{
"name": "endroid/qr-code",
"version": "6.0.3",
"version_normalized": "6.0.3.0",
"version": "5.1.0",
"version_normalized": "5.1.0.0",
"source": {
"type": "git",
"url": "https://github.com/endroid/qr-code.git",
"reference": "bdbb06e767efe9abe3c00461662b4059a6cd0b55"
"reference": "393fec6c4cbdc1bd65570ac9d245704428010122"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/endroid/qr-code/zipball/bdbb06e767efe9abe3c00461662b4059a6cd0b55",
"reference": "bdbb06e767efe9abe3c00461662b4059a6cd0b55",
"url": "https://api.github.com/repos/endroid/qr-code/zipball/393fec6c4cbdc1bd65570ac9d245704428010122",
"reference": "393fec6c4cbdc1bd65570ac9d245704428010122",
"shasum": ""
},
"require": {
"bacon/bacon-qr-code": "^3.0",
"php": "^8.2"
"php": "^8.1"
},
"require-dev": {
"endroid/quality": "dev-main",
Expand All @@ -141,11 +141,11 @@
"roave/security-advisories": "Makes sure package versions with known security issues are not installed",
"setasign/fpdf": "Enables you to use the PDF writer"
},
"time": "2024-10-29T19:28:52+00:00",
"time": "2024-09-08T08:52:55+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "6.x-dev"
"dev-main": "5.x-dev"
}
},
"installation-source": "dist",
Expand Down Expand Up @@ -175,7 +175,7 @@
],
"support": {
"issues": "https://github.com/endroid/qr-code/issues",
"source": "https://github.com/endroid/qr-code/tree/6.0.3"
"source": "https://github.com/endroid/qr-code/tree/5.1.0"
},
"funding": [
{
Expand Down
18 changes: 9 additions & 9 deletions thirdparty/vendor/composer/installed.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?php return array(
'root' => array(
'name' => '__root__',
'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0',
'reference' => null,
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '3df00d32bdf28fa01721eb73f8cb7cf851e8a446',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev' => true,
),
'versions' => array(
'__root__' => array(
'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0',
'reference' => null,
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '3df00d32bdf28fa01721eb73f8cb7cf851e8a446',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -38,9 +38,9 @@
'dev_requirement' => false,
),
'endroid/qr-code' => array(
'pretty_version' => '6.0.3',
'version' => '6.0.3.0',
'reference' => 'bdbb06e767efe9abe3c00461662b4059a6cd0b55',
'pretty_version' => '5.1.0',
'version' => '5.1.0.0',
'reference' => '393fec6c4cbdc1bd65570ac9d245704428010122',
'type' => 'library',
'install_path' => __DIR__ . '/../endroid/qr-code',
'aliases' => array(),
Expand Down
4 changes: 2 additions & 2 deletions thirdparty/vendor/composer/platform_check.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

$issues = array();

if (!(PHP_VERSION_ID >= 80200)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 8.2.0". You are running ' . PHP_VERSION . '.';
if (!(PHP_VERSION_ID >= 80100)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.';
}

if ($issues) {
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/vendor/endroid/qr-code/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2024 (c) Jeroen van den Enden
Copyright 2023 (c) Jeroen van den Enden

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
80 changes: 35 additions & 45 deletions thirdparty/vendor/endroid/qr-code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,27 @@ use Endroid\QrCode\Builder\Builder;
use Endroid\QrCode\Encoding\Encoding;
use Endroid\QrCode\ErrorCorrectionLevel;
use Endroid\QrCode\Label\LabelAlignment;
use Endroid\QrCode\Label\Font\OpenSans;
use Endroid\QrCode\Label\Font\NotoSans;
use Endroid\QrCode\RoundBlockSizeMode;
use Endroid\QrCode\Writer\PngWriter;

$builder = new Builder(
writer: new PngWriter(),
writerOptions: [],
validateResult: false,
data: 'Custom QR code contents',
encoding: new Encoding('UTF-8'),
errorCorrectionLevel: ErrorCorrectionLevel::High,
size: 300,
margin: 10,
roundBlockSizeMode: RoundBlockSizeMode::Margin,
logoPath: __DIR__.'/assets/symfony.png',
logoResizeToWidth: 50,
logoPunchoutBackground: true,
labelText: 'This is the label',
labelFont: new OpenSans(20),
labelAlignment: LabelAlignment::Center
);

$result = $builder->build();
$result = Builder::create()
->writer(new PngWriter())
->writerOptions([])
->data('Custom QR code contents')
->encoding(new Encoding('UTF-8'))
->errorCorrectionLevel(ErrorCorrectionLevel::High)
->size(300)
->margin(10)
->roundBlockSizeMode(RoundBlockSizeMode::Margin)
->logoPath(__DIR__.'/assets/symfony.png')
->logoResizeToWidth(50)
->logoPunchoutBackground(true)
->labelText('This is the label')
->labelFont(new NotoSans(20))
->labelAlignment(LabelAlignment::Center)
->validateResult(false)
->build();
```

## Usage: without using the builder
Expand All @@ -75,29 +73,24 @@ use Endroid\QrCode\Writer\ValidationException;
$writer = new PngWriter();

// Create QR code
$qrCode = new QrCode(
data: 'Life is too short to be generating QR codes',
encoding: new Encoding('UTF-8'),
errorCorrectionLevel: ErrorCorrectionLevel::Low,
size: 300,
margin: 10,
roundBlockSizeMode: RoundBlockSizeMode::Margin,
foregroundColor: new Color(0, 0, 0),
backgroundColor: new Color(255, 255, 255)
);
$qrCode = QrCode::create('Life is too short to be generating QR codes')
->setEncoding(new Encoding('UTF-8'))
->setErrorCorrectionLevel(ErrorCorrectionLevel::Low)
->setSize(300)
->setMargin(10)
->setRoundBlockSizeMode(RoundBlockSizeMode::Margin)
->setForegroundColor(new Color(0, 0, 0))
->setBackgroundColor(new Color(255, 255, 255));

// Create generic logo
$logo = new Logo(
path: __DIR__.'/assets/symfony.png',
resizeToWidth: 50,
punchoutBackground: true
);
$logo = Logo::create(__DIR__.'/assets/symfony.png')
->setResizeToWidth(50)
->setPunchoutBackground(true)
;

// Create generic label
$label = new Label(
text: 'Label',
textColor: new Color(255, 0, 0)
);
$label = Label::create('Label')
->setTextColor(new Color(255, 0, 0));

$result = $writer->write($qrCode, $logo, $label);

Expand Down Expand Up @@ -149,12 +142,9 @@ You can provide any writer options like this.
```php
use Endroid\QrCode\Writer\SvgWriter;

$builder = new Builder(
writer: new SvgWriter(),
writerOptions: [
SvgWriter::WRITER_OPTION_EXCLUDE_XML_DECLARATION => true
]
);
$builder->writerOptions([
SvgWriter::WRITER_OPTION_EXCLUDE_XML_DECLARATION => true
]);
```

### Encoding
Expand Down
Binary file not shown.
4 changes: 2 additions & 2 deletions thirdparty/vendor/endroid/qr-code/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
],
"require": {
"php": "^8.2",
"php": "^8.1",
"bacon/bacon-qr-code": "^3.0"
},
"require-dev": {
Expand Down Expand Up @@ -48,7 +48,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "6.x-dev"
"dev-main": "5.x-dev"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
use BaconQrCode\Common\ErrorCorrectionLevel as BaconErrorCorrectionLevel;
use Endroid\QrCode\ErrorCorrectionLevel;

final readonly class ErrorCorrectionLevelConverter
final class ErrorCorrectionLevelConverter
{
public static function convertToBaconErrorCorrectionLevel(ErrorCorrectionLevel $errorCorrectionLevel): BaconErrorCorrectionLevel
{
return match ($errorCorrectionLevel) {
ErrorCorrectionLevel::Low => BaconErrorCorrectionLevel::valueOf('L'),
ErrorCorrectionLevel::Medium => BaconErrorCorrectionLevel::valueOf('M'),
ErrorCorrectionLevel::Quartile => BaconErrorCorrectionLevel::valueOf('Q'),
ErrorCorrectionLevel::High => BaconErrorCorrectionLevel::valueOf('H'),
ErrorCorrectionLevel::High => BaconErrorCorrectionLevel::valueOf('H')
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Endroid\QrCode\Matrix\MatrixInterface;
use Endroid\QrCode\QrCodeInterface;

final readonly class MatrixFactory implements MatrixFactoryInterface
final class MatrixFactory implements MatrixFactoryInterface
{
public function create(QrCodeInterface $qrCode): MatrixInterface
{
Expand Down
Loading

0 comments on commit ffc8d3c

Please sign in to comment.