Skip to content

Commit

Permalink
Bump chillerlan/php-qrcode from 5.0.2 to 5.0.3 #97
Browse files Browse the repository at this point in the history
  • Loading branch information
Nightprince committed Dec 3, 2024
1 parent 36a1596 commit af999e5
Show file tree
Hide file tree
Showing 39 changed files with 220 additions and 1,089 deletions.
851 changes: 0 additions & 851 deletions vendor/chillerlan/php-qrcode/.idea/codeStyles/Project.xml

This file was deleted.

This file was deleted.

This file was deleted.

39 changes: 22 additions & 17 deletions vendor/chillerlan/php-qrcode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ It also features a QR Code reader based on a [PHP port](https://github.com/khana
[![Packagist downloads][downloads-badge]][downloads]
[![Documentation][readthedocs-badge]][readthedocs]

[php-badge]: https://img.shields.io/packagist/php-v/chillerlan/php-qrcode?logo=php&color=8892BF
[php-badge]: https://img.shields.io/packagist/php-v/chillerlan/php-qrcode?logo=php&color=8892BF&logoColor=fff
[php]: https://www.php.net/supported-versions.php
[packagist-badge]: https://img.shields.io/packagist/v/chillerlan/php-qrcode.svg?logo=packagist
[packagist-badge]: https://img.shields.io/packagist/v/chillerlan/php-qrcode.svg?logo=packagist&logoColor=fff
[packagist]: https://packagist.org/packages/chillerlan/php-qrcode
[gh-action-badge]: https://img.shields.io/github/actions/workflow/status/chillerlan/php-qrcode/ci.yml?branch=v5.0.x&logo=github
[gh-action-badge]: https://img.shields.io/github/actions/workflow/status/chillerlan/php-qrcode/ci.yml?branch=v5.0.x&logo=github&logoColor=fff
[gh-action]: https://github.com/chillerlan/php-qrcode/actions/workflows/ci.yml?query=branch%3Amain
[coverage-badge]: https://img.shields.io/codecov/c/github/chillerlan/php-qrcode/v5.0.x?logo=codecov
[coverage-badge]: https://img.shields.io/codecov/c/github/chillerlan/php-qrcode/v5.0.x?logo=codecov&logoColor=fff
[coverage]: https://app.codecov.io/gh/chillerlan/php-qrcode/tree/v5.0.x
[codacy-badge]: https://img.shields.io/codacy/grade/edccfc4fe5a34b74b1c53ee03f097b8d/v5.0.x?logo=codacy
[codacy-badge]: https://img.shields.io/codacy/grade/edccfc4fe5a34b74b1c53ee03f097b8d/v5.0.x?logo=codacy&logoColor=fff
[codacy]: https://app.codacy.com/gh/chillerlan/php-qrcode/dashboard?branch=v5.0.x
[downloads-badge]: https://img.shields.io/packagist/dt/chillerlan/php-qrcode?logo=packagist
[downloads-badge]: https://img.shields.io/packagist/dt/chillerlan/php-qrcode?logo=packagist&logoColor=fff
[downloads]: https://packagist.org/packages/chillerlan/php-qrcode/stats
[readthedocs-badge]: https://img.shields.io/readthedocs/php-qrcode/v5.0.x?logo=readthedocs
[readthedocs-badge]: https://img.shields.io/readthedocs/php-qrcode/v5.0.x?logo=readthedocs&logoColor=fff
[readthedocs]: https://php-qrcode.readthedocs.io/en/v5.0.x/

## Overview
# Overview

### Features
## Features

- Creation of [Model 2 QR Codes](https://www.qrcode.com/en/codes/model12.html), [Version 1 to 40](https://www.qrcode.com/en/about/version.html)
- [ECC Levels](https://www.qrcode.com/en/about/error_correction.html) L/M/Q/H supported
Expand All @@ -52,7 +52,7 @@ It also features a QR Code reader based on a [PHP port](https://github.com/khana
- QR Code reader (via GD and ImageMagick)


### Requirements
## Requirements

- PHP 7.4+
- [`ext-mbstring`](https://www.php.net/manual/book.mbstring.php)
Expand All @@ -65,12 +65,17 @@ It also features a QR Code reader based on a [PHP port](https://github.com/khana
For the QRCode reader, either `ext-gd` or `ext-imagick` is required!


## Documentation
# Documentation

- The user manual is at https://php-qrcode.readthedocs.io/ ([sources](https://github.com/chillerlan/php-qrcode/tree/v5.0.x/docs))
- An API documentation created with [phpDocumentor](https://www.phpdoc.org/) can be found at https://chillerlan.github.io/php-qrcode/
- The documentation for the `QROptions` container can be found here: [chillerlan/php-settings-container](https://github.com/chillerlan/php-settings-container#readme)

**Important: Please use the examples from the branch that matches your installed php-qrcode version (
[v4.x](https://github.com/chillerlan/php-qrcode/tree/v4.3.x/examples),
[v5.x](https://github.com/chillerlan/php-qrcode/tree/v5.0.x/examples),
[dev-main](https://github.com/chillerlan/php-qrcode/tree/main/examples)
)!**

## Installation with [composer](https://getcomposer.org)

Expand Down Expand Up @@ -117,7 +122,7 @@ Also, have a look [in the examples folder](https://github.com/chillerlan/php-qrc
</p>


### Reading QR Codes
## Reading QR Codes

Using the built-in QR Code reader is pretty straight-forward:

Expand All @@ -139,30 +144,30 @@ catch(Throwable $e){
```


## Shameless advertising
# Shameless advertising

Hi, please check out some of my other projects that are way cooler than qrcodes!

- [js-qrcode](https://github.com/chillerlan/js-qrcode) - a javascript port of this library
- [php-authenticator](https://github.com/chillerlan/php-authenticator) - a Google Authenticator implementation (see [authenticator example](https://github.com/chillerlan/php-qrcode/blob/v5.0.x/examples/authenticator.php))
- [php-httpinterface](https://github.com/chillerlan/php-httpinterface) - a PSR-7/15/17/18 implemetation
- [php-oauth-core](https://github.com/chillerlan/php-oauth-core) - an OAuth 1/2 client library along with a bunch of [providers](https://github.com/chillerlan/php-oauth-providers)
- [php-oauth](https://github.com/chillerlan/php-oauth) - an OAuth 1/2 client library, fully PSR-7/PSR-17/PSR-18 compatible
- [php-database](https://github.com/chillerlan/php-database) - a database client & querybuilder for MySQL, Postgres, SQLite, MSSQL, Firebird
- [php-tootbot](https://github.com/php-tootbot/tootbot-template) - a Mastodon bot library (see [@dwil](https://github.com/php-tootbot/dwil))


## Disclaimer!
# Disclaimer!

I don't take responsibility for molten CPUs, misled applications, failed log-ins etc.. Use at your own risk!


### License notice
## License notice

- Parts of this code are [ported to PHP](https://github.com/codemasher/php-qrcode-decoder) from the [ZXing project](https://github.com/zxing/zxing) and licensed under the [Apache License, Version 2.0](./NOTICE).
- [The documentation](https://github.com/chillerlan/php-qrcode/tree/v5.0.x/docs) is licensed under the [Creative Commons Attribution 4.0 International (CC BY 4.0) License](https://creativecommons.org/licenses/by/4.0/).


### Trademark Notice
## Trademark Notice

The word "QR Code" is a registered trademark of *DENSO WAVE INCORPORATED*<br>
https://www.qrcode.com/en/faq.html#patentH2Title
35 changes: 25 additions & 10 deletions vendor/chillerlan/php-qrcode/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "https://getcomposer.org/schema.json",
"name": "chillerlan/php-qrcode",
"description": "A QR code generator and reader with a user friendly API. PHP 7.4+",
"description": "A QR Code generator and reader with a user-friendly API. PHP 7.4+",
"homepage": "https://github.com/chillerlan/php-qrcode",
"license": [
"MIT", "Apache-2.0"
Expand Down Expand Up @@ -32,6 +33,12 @@
"homepage":"https://github.com/chillerlan/php-qrcode/graphs/contributors"
}
],
"funding": [
{
"type": "Ko-Fi",
"url": "https://ko-fi.com/codemasher"
}
],
"support": {
"docs": "https://php-qrcode.readthedocs.io",
"issues": "https://github.com/chillerlan/php-qrcode/issues",
Expand All @@ -42,15 +49,18 @@
"require": {
"php": "^7.4 || ^8.0",
"ext-mbstring": "*",
"chillerlan/php-settings-container": "^2.1.4 || ^3.1"
"chillerlan/php-settings-container": "^2.1.6 || ^3.2.1"
},
"require-dev": {
"chillerlan/php-authenticator": "^4.1 || ^5.1",
"phan/phan": "^5.4",
"ext-fileinfo": "*",
"chillerlan/php-authenticator": "^4.3.1 || ^5.2.1",
"phan/phan": "^5.4.5",
"phpcompatibility/php-compatibility": "10.x-dev",
"phpunit/phpunit": "^9.6",
"phpmd/phpmd": "^2.15",
"setasign/fpdf": "^1.8.2",
"squizlabs/php_codesniffer": "^3.8"
"slevomat/coding-standard": "^8.15",
"squizlabs/php_codesniffer": "^3.11"
},
"suggest": {
"chillerlan/php-authenticator": "Yet another Google authenticator! Also creates URIs for mobile apps.",
Expand All @@ -59,21 +69,26 @@
},
"autoload": {
"psr-4": {
"chillerlan\\QRCode\\": "src/"
"chillerlan\\QRCode\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"chillerlan\\QRCodeTest\\": "tests/"
"chillerlan\\QRCodeTest\\": "tests"
}
},
"scripts": {
"phpunit": "@php vendor/bin/phpunit",
"phan": "@php vendor/bin/phan"
"phan": "@php vendor/bin/phan",
"phpcs": "@php vendor/bin/phpcs",
"phpmd": "@php vendor/bin/phpmd src text ./phpmd.xml.dist",
"phpunit": "@php vendor/bin/phpunit"
},
"config": {
"lock": false,
"sort-packages": true,
"platform-check": true
"platform-check": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
6 changes: 3 additions & 3 deletions vendor/chillerlan/php-qrcode/src/Common/GDLuminanceSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class GDLuminanceSource extends LuminanceSourceAbstract{
*
* @throws \chillerlan\QRCode\Decoder\QRCodeDecoderException
*/
public function __construct($gdImage, SettingsContainerInterface $options = null){
public function __construct($gdImage, ?SettingsContainerInterface $options = null){

/** @noinspection PhpFullyQualifiedNameUsageInspection */
if(
Expand Down Expand Up @@ -85,12 +85,12 @@ protected function setLuminancePixels():void{
}

/** @inheritDoc */
public static function fromFile(string $path, SettingsContainerInterface $options = null):self{
public static function fromFile(string $path, ?SettingsContainerInterface $options = null):self{
return new self(imagecreatefromstring(file_get_contents(self::checkFile($path))), $options);
}

/** @inheritDoc */
public static function fromBlob(string $blob, SettingsContainerInterface $options = null):self{
public static function fromBlob(string $blob, ?SettingsContainerInterface $options = null):self{
return new self(imagecreatefromstring($blob), $options);
}

Expand Down
2 changes: 1 addition & 1 deletion vendor/chillerlan/php-qrcode/src/Common/GenericGFPoly.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class GenericGFPoly{
* @throws \chillerlan\QRCode\QRCodeException if argument is null or empty, or if leading coefficient is 0 and this
* is not a constant polynomial (that is, it is not the monomial "0")
*/
public function __construct(array $coefficients, int $degree = null){
public function __construct(array $coefficients, ?int $degree = null){
$degree ??= 0;

if(empty($coefficients)){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class IMagickLuminanceSource extends LuminanceSourceAbstract{
/**
* IMagickLuminanceSource constructor.
*/
public function __construct(Imagick $imagick, SettingsContainerInterface $options = null){
public function __construct(Imagick $imagick, ?SettingsContainerInterface $options = null){
parent::__construct($imagick->getImageWidth(), $imagick->getImageHeight(), $options);

$this->imagick = $imagick;
Expand Down Expand Up @@ -63,12 +63,12 @@ protected function setLuminancePixels():void{
}

/** @inheritDoc */
public static function fromFile(string $path, SettingsContainerInterface $options = null):self{
public static function fromFile(string $path, ?SettingsContainerInterface $options = null):self{
return new self(new Imagick(self::checkFile($path)), $options);
}

/** @inheritDoc */
public static function fromBlob(string $blob, SettingsContainerInterface $options = null):self{
public static function fromBlob(string $blob, ?SettingsContainerInterface $options = null):self{
$im = new Imagick;
$im->readImageBlob($blob);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract class LuminanceSourceAbstract implements LuminanceSourceInterface{
/**
*
*/
public function __construct(int $width, int $height, SettingsContainerInterface $options = null){
public function __construct(int $width, int $height, ?SettingsContainerInterface $options = null){
$this->width = $width;
$this->height = $height;
$this->options = ($options ?? new QROptions);
Expand All @@ -57,7 +57,10 @@ public function getHeight():int{
return $this->height;
}

/** @inheritDoc */
/**
* @inheritDoc
* @throws \chillerlan\QRCode\Decoder\QRCodeDecoderException
*/
public function getRow(int $y):array{

if($y < 0 || $y >= $this->getHeight()){
Expand Down
2 changes: 1 addition & 1 deletion vendor/chillerlan/php-qrcode/src/Common/MaskPattern.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ final class MaskPattern{
*/
public function __construct(int $maskPattern){

if((0b111 & $maskPattern) !== $maskPattern){
if(($maskPattern & 0b111) !== $maskPattern){
throw new QRCodeException('invalid mask pattern');
}

Expand Down
Loading

0 comments on commit af999e5

Please sign in to comment.