mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-28 02:57:57 +00:00
✨ dropped PHP < 7.2, dependency update
This commit is contained in:
+6
-4
@@ -1,9 +1,11 @@
|
||||
language: php
|
||||
|
||||
php:
|
||||
- 7.0
|
||||
- 7.1
|
||||
- 7.2
|
||||
matrix:
|
||||
include:
|
||||
- php: 7.2
|
||||
- php: nightly
|
||||
allow_failures:
|
||||
- php: nightly
|
||||
|
||||
install: travis_retry composer install --no-interaction --prefer-source
|
||||
|
||||
|
||||
+4
-6
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "chillerlan/php-qrcode",
|
||||
"description": "A QR code generator. PHP 7+",
|
||||
"description": "A QR code generator. PHP 7.2+",
|
||||
"homepage": "https://github.com/chillerlan/php-qrcode",
|
||||
"license": "MIT",
|
||||
"minimum-stability": "stable",
|
||||
@@ -20,15 +20,13 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.0.3",
|
||||
"chillerlan/php-traits": "^1.1"
|
||||
"php": ">=7.2.0",
|
||||
"chillerlan/php-traits": "^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^6.5",
|
||||
"phpunit/phpunit": "^7.3",
|
||||
"chillerlan/php-authenticator": "^2.0"
|
||||
},
|
||||
"suggest": {
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"chillerlan\\QRCode\\": "src/"
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
syntaxCheck="false"
|
||||
>
|
||||
<filter>
|
||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
||||
|
||||
@@ -18,8 +18,9 @@ use chillerlan\QRCode\{
|
||||
use chillerlan\QRCode\Helpers\{
|
||||
BitBuffer, Polynomial
|
||||
};
|
||||
use chillerlan\Traits\ClassLoader;
|
||||
use chillerlan\Traits\ContainerInterface;
|
||||
use chillerlan\Traits\{
|
||||
ClassLoader, ImmutableSettingsInterface
|
||||
};
|
||||
|
||||
/**
|
||||
* Processes the binary data and maps it on a matrix which is then being returned
|
||||
@@ -89,10 +90,10 @@ abstract class QRDataAbstract implements QRDataInterface{
|
||||
/**
|
||||
* QRDataInterface constructor.
|
||||
*
|
||||
* @param \chillerlan\Traits\ContainerInterface $options
|
||||
* @param \chillerlan\Traits\ImmutableSettingsInterface $options
|
||||
* @param string|null $data
|
||||
*/
|
||||
public function __construct(ContainerInterface $options, string $data = null){
|
||||
public function __construct(ImmutableSettingsInterface $options, string $data = null){
|
||||
$this->options = $options;
|
||||
|
||||
if($data !== null){
|
||||
@@ -186,6 +187,7 @@ abstract class QRDataAbstract implements QRDataInterface{
|
||||
* @throws \chillerlan\QRCode\Data\QRCodeDataException
|
||||
*/
|
||||
protected function getMinimumVersion():int{
|
||||
$maxlength = 0;
|
||||
|
||||
// guess the version number within the given range
|
||||
foreach(range(max(1, $this->options->versionMin), min($this->options->versionMax, 40)) as $version){
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace chillerlan\QRCode\Output;
|
||||
use chillerlan\QRCode\{
|
||||
Data\QRMatrix, QRCode
|
||||
};
|
||||
use chillerlan\Traits\ContainerInterface;
|
||||
use chillerlan\Traits\ImmutableSettingsInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -50,10 +50,10 @@ abstract class QROutputAbstract implements QROutputInterface{
|
||||
/**
|
||||
* QROutputAbstract constructor.
|
||||
*
|
||||
* @param \chillerlan\Traits\ContainerInterface $options
|
||||
* @param \chillerlan\Traits\ImmutableSettingsInterface $options
|
||||
* @param \chillerlan\QRCode\Data\QRMatrix $matrix
|
||||
*/
|
||||
public function __construct(ContainerInterface $options, QRMatrix $matrix){
|
||||
public function __construct(ImmutableSettingsInterface $options, QRMatrix $matrix){
|
||||
$this->options = $options;
|
||||
$this->matrix = $matrix;
|
||||
$this->moduleCount = $this->matrix->size();
|
||||
|
||||
+5
-5
@@ -19,7 +19,7 @@ use chillerlan\QRCode\Output\{
|
||||
QRCodeOutputException, QRImage, QRMarkup, QROutputInterface, QRString
|
||||
};
|
||||
use chillerlan\Traits\{
|
||||
ClassLoader, ContainerInterface
|
||||
ClassLoader, ImmutableSettingsInterface
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -106,9 +106,9 @@ class QRCode{
|
||||
/**
|
||||
* QRCode constructor.
|
||||
*
|
||||
* @param \chillerlan\Traits\ContainerInterface|null $options
|
||||
* @param \chillerlan\Traits\ImmutableSettingsInterface|null $options
|
||||
*/
|
||||
public function __construct(ContainerInterface $options = null){
|
||||
public function __construct(ImmutableSettingsInterface $options = null){
|
||||
mb_internal_encoding('UTF-8');
|
||||
|
||||
$this->setOptions($options ?? new QROptions);
|
||||
@@ -117,12 +117,12 @@ class QRCode{
|
||||
/**
|
||||
* Sets the options, called internally by the constructor
|
||||
*
|
||||
* @param \chillerlan\Traits\ContainerInterface $options
|
||||
* @param \chillerlan\Traits\ImmutableSettingsInterface $options
|
||||
*
|
||||
* @return \chillerlan\QRCode\QRCode
|
||||
* @throws \chillerlan\QRCode\QRCodeException
|
||||
*/
|
||||
public function setOptions(ContainerInterface $options):QRCode{
|
||||
public function setOptions(ImmutableSettingsInterface $options):QRCode{
|
||||
|
||||
if(!array_key_exists($options->eccLevel, $this::ECC_MODES)){
|
||||
throw new QRCodeException('Invalid error correct level: '.$options->eccLevel);
|
||||
|
||||
+2
-2
@@ -12,7 +12,7 @@
|
||||
|
||||
namespace chillerlan\QRCode;
|
||||
|
||||
use chillerlan\Traits\ContainerAbstract;
|
||||
use chillerlan\Traits\ImmutableSettingsAbstract;
|
||||
|
||||
/**
|
||||
* @property int $version
|
||||
@@ -45,6 +45,6 @@ use chillerlan\Traits\ContainerAbstract;
|
||||
*
|
||||
* @property array $moduleValues
|
||||
*/
|
||||
class QROptions extends ContainerAbstract{
|
||||
class QROptions extends ImmutableSettingsAbstract{
|
||||
use QROptionsTrait;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user