File tree Expand file tree Collapse file tree 7 files changed +12
-10
lines changed Expand file tree Collapse file tree 7 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 15
15
// please excuse the IDE yelling https://youtrack.jetbrains.com/issue/WI-66549
16
16
$ options = new QROptions ;
17
17
$ options ->readerUseImagickIfAvailable = false ;
18
- $ options ->readerGrayscale = true ;
19
- $ options ->readerIncreaseContrast = true ;
18
+ $ options ->readerGrayscale = true ;
19
+ $ options ->readerIncreaseContrast = true ;
20
20
21
21
try {
22
22
$ result = (new QRCode ($ options ))->readFromFile (__DIR__ .'/../.github/images/example_image.png ' );
Original file line number Diff line number Diff line change 5
5
* eliminate hairline antialias "cracks" that tend to appear when two SVG paths are exactly adjacent to each other.
6
6
*
7
7
* @see https://github.com/chillerlan/php-qrcode/issues/127
8
+ * @see ./shapes.svg
8
9
*/
9
10
10
11
use chillerlan \QRCode \{QRCode , QROptions };
@@ -48,7 +49,7 @@ protected function collectModules(Closure $transform):array{
48
49
$ M_TYPE_LAYER = QRMatrix::M_DATA ;
49
50
50
51
if ($ this ->matrix ->check ($ x , $ y )){
51
- $ M_TYPE_LAYER | = QRMatrix::IS_DARK ;
52
+ $ M_TYPE_LAYER = QRMatrix::M_DATA_DARK ;
52
53
}
53
54
}
54
55
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ protected function collectModules(Closure $transform):array{
53
53
$ M_TYPE_LAYER = QRMatrix::M_DATA ;
54
54
55
55
if ($ this ->matrix ->check ($ x , $ y )){
56
- $ M_TYPE_LAYER | = QRMatrix::IS_DARK ;
56
+ $ M_TYPE_LAYER = QRMatrix::M_DATA_DARK ;
57
57
}
58
58
}
59
59
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ protected function createMarkup(bool $saveToFile):string{
44
44
$ this ->colorQuietzone ($ quietzoneSize , ($ diameter / 2 ));
45
45
46
46
// calculate the logo space
47
- $ logoSpaceSize = (int )ceil ($ this ->moduleCount * $ this ->options ->svgLogoScale );
47
+ $ logoSpaceSize = (int )( ceil ($ this ->moduleCount * $ this ->options ->svgLogoScale ) + 1 );
48
48
// we're calling QRMatrix::setLogoSpace() manually, so QROptions::$addLogoSpace has no effect here
49
49
$ this ->matrix ->setLogoSpace ($ logoSpaceSize );
50
50
@@ -185,7 +185,7 @@ protected function collectModules(Closure $transform):array{
185
185
$ M_TYPE_LAYER = QRMatrix::M_DATA ;
186
186
187
187
if ($ this ->matrix ->check ($ x , $ y )){
188
- $ M_TYPE_LAYER | = QRMatrix::IS_DARK ;
188
+ $ M_TYPE_LAYER = QRMatrix::M_DATA_DARK ;
189
189
}
190
190
}
191
191
@@ -335,7 +335,7 @@ protected function set_svgLogoScale(float $svgLogoScale):void{
335
335
QRMatrix::M_FINDER_DARK ,
336
336
QRMatrix::M_FINDER_DOT ,
337
337
QRMatrix::M_ALIGNMENT_DARK ,
338
- ( QRMatrix::M_QUIETZONE | QRMatrix:: IS_DARK ) ,
338
+ QRMatrix::M_QUIETZONE_DARK ,
339
339
],
340
340
'drawCircularModules ' => true ,
341
341
'circleRadius ' => 0.4 ,
Original file line number Diff line number Diff line change @@ -87,7 +87,8 @@ protected function getCssClass(int $M_TYPE = 0):string{
87
87
}
88
88
89
89
/**
90
- *
90
+ * returns the fully parsed and rendered markup string for the given input
91
91
*/
92
92
abstract protected function createMarkup (bool $ saveToFile ):string ;
93
+
93
94
}
Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ protected function collectModules(Closure $transform):array{
187
187
$ M_TYPE_LAYER = QRMatrix::M_DATA ;
188
188
189
189
if ($ this ->matrix ->check ($ x , $ y )){
190
- $ M_TYPE_LAYER | = QRMatrix::IS_DARK ;
190
+ $ M_TYPE_LAYER = QRMatrix::M_DATA_DARK ;
191
191
}
192
192
}
193
193
Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ public function testGetSetCheck():void{
176
176
public static function matrixProvider ():Generator {
177
177
$ ecc = new EccLevel (EccLevel::L);
178
178
179
- foreach ( range ( 1 , 40 ) as $ i ){
179
+ for ( $ i = 1 ; $ i <= 40 ; $ i ++ ){
180
180
yield 'version: ' .$ i => [new QRMatrix (new Version ($ i ), $ ecc )];
181
181
}
182
182
}
You can’t perform that action at this time.
0 commit comments