Skip to content

Commit 408f463

Browse files
committed
:octocat: convert magic setters to property hooks
1 parent f2851c8 commit 408f463

File tree

2 files changed

+128
-198
lines changed

2 files changed

+128
-198
lines changed

src/QRCodeReaderOptionsTrait.php

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,34 @@
1515

1616
/**
1717
* Trait QRCodeReaderOptionsTrait
18-
*
19-
* @property bool $readerUseImagickIfAvailable
20-
* @property bool $readerGrayscale
21-
* @property bool $readerInvertColors
22-
* @property bool $readerIncreaseContrast
2318
*/
2419
trait QRCodeReaderOptionsTrait{
2520

2621
/**
27-
* Use Imagick (if available) when reading QR Codes
22+
* Use Imagick (if available) when reading QR Codes,
23+
* enables Imagick for the QR Code reader if the extension is available
2824
*/
29-
protected bool $readerUseImagickIfAvailable = false;
25+
public bool $readerUseImagickIfAvailable = false {
26+
set{
27+
$this->readerUseImagickIfAvailable = ($value && extension_loaded('imagick'));
28+
}
29+
}
3030

3131
/**
3232
* Grayscale the image before reading
3333
*/
34-
protected bool $readerGrayscale = false;
34+
public bool $readerGrayscale = false;
3535

3636
/**
3737
* Invert the colors of the image
3838
*/
39-
protected bool $readerInvertColors = false;
39+
public bool $readerInvertColors = false;
4040

4141
/**
4242
* Increase the contrast before reading
4343
*
4444
* note that applying contrast works different in GD and Imagick, so mileage may vary
4545
*/
46-
protected bool $readerIncreaseContrast = false;
47-
48-
/**
49-
* enables Imagick for the QR Code reader if the extension is available
50-
*/
51-
protected function set_readerUseImagickIfAvailable(bool $useImagickIfAvailable):void{
52-
$this->readerUseImagickIfAvailable = ($useImagickIfAvailable && extension_loaded('imagick'));
53-
}
46+
public bool $readerIncreaseContrast = false;
5447

5548
}

0 commit comments

Comments
 (0)