mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-09-17 21:26:52 +00:00
:octocat: removed chillerlan/traits dependency
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.2.0",
|
||||
"chillerlan/php-traits": "^2.0"
|
||||
"chillerlan/php-settings-container": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^7.3"
|
||||
|
||||
@@ -12,15 +12,9 @@
|
||||
|
||||
namespace chillerlan\QRCode\Data;
|
||||
|
||||
use chillerlan\QRCode\{
|
||||
QRCode, QRCodeException, QROptions
|
||||
};
|
||||
use chillerlan\QRCode\Helpers\{
|
||||
BitBuffer, Polynomial
|
||||
};
|
||||
use chillerlan\Traits\{
|
||||
ImmutableSettingsInterface
|
||||
};
|
||||
use chillerlan\QRCode\{QRCode, QRCodeException};
|
||||
use chillerlan\QRCode\Helpers\{BitBuffer, Polynomial};
|
||||
use chillerlan\Settings\SettingsContainerInterface;
|
||||
|
||||
/**
|
||||
* Processes the binary data and maps it on a matrix which is then being returned
|
||||
@@ -89,10 +83,10 @@ abstract class QRDataAbstract implements QRDataInterface{
|
||||
/**
|
||||
* QRDataInterface constructor.
|
||||
*
|
||||
* @param \chillerlan\Traits\ImmutableSettingsInterface $options
|
||||
* @param \chillerlan\Settings\SettingsContainerInterface $options
|
||||
* @param string|null $data
|
||||
*/
|
||||
public function __construct(ImmutableSettingsInterface $options, string $data = null){
|
||||
public function __construct(SettingsContainerInterface $options, string $data = null){
|
||||
$this->options = $options;
|
||||
|
||||
if($data !== null){
|
||||
|
||||
@@ -12,10 +12,8 @@
|
||||
|
||||
namespace chillerlan\QRCode\Output;
|
||||
|
||||
use chillerlan\QRCode\{
|
||||
Data\QRMatrix, QRCode
|
||||
};
|
||||
use chillerlan\Traits\ImmutableSettingsInterface;
|
||||
use chillerlan\QRCode\{Data\QRMatrix, QRCode};
|
||||
use chillerlan\Settings\SettingsContainerInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -50,10 +48,10 @@ abstract class QROutputAbstract implements QROutputInterface{
|
||||
/**
|
||||
* QROutputAbstract constructor.
|
||||
*
|
||||
* @param \chillerlan\Traits\ImmutableSettingsInterface $options
|
||||
* @param \chillerlan\Settings\SettingsContainerInterface $options
|
||||
* @param \chillerlan\QRCode\Data\QRMatrix $matrix
|
||||
*/
|
||||
public function __construct(ImmutableSettingsInterface $options, QRMatrix $matrix){
|
||||
public function __construct(SettingsContainerInterface $options, QRMatrix $matrix){
|
||||
$this->options = $options;
|
||||
$this->matrix = $matrix;
|
||||
$this->moduleCount = $this->matrix->size();
|
||||
|
||||
+5
-7
@@ -18,9 +18,7 @@ use chillerlan\QRCode\Data\{
|
||||
use chillerlan\QRCode\Output\{
|
||||
QRCodeOutputException, QRImage, QRMarkup, QROutputInterface, QRString
|
||||
};
|
||||
use chillerlan\Traits\{
|
||||
ImmutableSettingsInterface
|
||||
};
|
||||
use chillerlan\Settings\SettingsContainerInterface;
|
||||
|
||||
/**
|
||||
* Turns a text string into a Model 2 QR Code
|
||||
@@ -105,9 +103,9 @@ class QRCode{
|
||||
/**
|
||||
* QRCode constructor.
|
||||
*
|
||||
* @param \chillerlan\Traits\ImmutableSettingsInterface|null $options
|
||||
* @param \chillerlan\Settings\SettingsContainerInterface|null $options
|
||||
*/
|
||||
public function __construct(ImmutableSettingsInterface $options = null){
|
||||
public function __construct(SettingsContainerInterface $options = null){
|
||||
mb_internal_encoding('UTF-8');
|
||||
|
||||
$this->setOptions($options ?? new QROptions);
|
||||
@@ -116,12 +114,12 @@ class QRCode{
|
||||
/**
|
||||
* Sets the options, called internally by the constructor
|
||||
*
|
||||
* @param \chillerlan\Traits\ImmutableSettingsInterface $options
|
||||
* @param \chillerlan\Settings\SettingsContainerInterface $options
|
||||
*
|
||||
* @return \chillerlan\QRCode\QRCode
|
||||
* @throws \chillerlan\QRCode\QRCodeException
|
||||
*/
|
||||
public function setOptions(ImmutableSettingsInterface $options):QRCode{
|
||||
public function setOptions(SettingsContainerInterface $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\ImmutableSettingsAbstract;
|
||||
use chillerlan\Settings\SettingsContainerAbstract;
|
||||
|
||||
/**
|
||||
* @property int $version
|
||||
@@ -45,6 +45,6 @@ use chillerlan\Traits\ImmutableSettingsAbstract;
|
||||
*
|
||||
* @property array $moduleValues
|
||||
*/
|
||||
class QROptions extends ImmutableSettingsAbstract{
|
||||
class QROptions extends SettingsContainerAbstract{
|
||||
use QROptionsTrait;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user