:octocat: use settings container in QRCodeReader

This commit is contained in:
codemasher
2021-11-18 14:00:30 +01:00
parent 6a5be44ea4
commit c79042f271
4 changed files with 50 additions and 17 deletions
+15 -1
View File
@@ -14,7 +14,7 @@ namespace chillerlan\QRCode;
use chillerlan\QRCode\Common\EccLevel;
use function array_values, count, in_array, is_numeric, max, min, sprintf, strtolower;
use function array_values, count, extension_loaded, in_array, is_numeric, max, min, sprintf, strtolower;
/**
* The QRCode plug-in settings & setter functionality
@@ -219,6 +219,11 @@ trait QROptionsTrait{
*/
protected ?array $moduleValues = null;
/**
* use Imaagick (if available) when reading QR Codes
*/
protected bool $useImagickIfAvailable = false;
/**
* clamp min/max version number
*/
@@ -328,4 +333,13 @@ trait QROptionsTrait{
// @todo throw or ignore silently?
}
/**
* enables Imagick for the QR Code reader if the extension is available
*
* @codeCoverageIgnore
*/
protected function set_useImagickIfAvailable(bool $useImagickIfAvailable):void{
$this->useImagickIfAvailable = $useImagickIfAvailable && extension_loaded('imagick');
}
}