File tree Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 7
7
* @copyright 2015 Smiley
8
8
* @license MIT
9
9
*
10
- * @noinspection PhpUnusedParameterInspection
11
10
* @noinspection PhpComposerExtensionStubsInspection
12
11
*/
13
12
@@ -65,7 +64,7 @@ public function dump(string $file = null):string{
65
64
* string output
66
65
*/
67
66
protected function text ():string {
68
- $ str = [];
67
+ $ lines = [];
69
68
70
69
for ($ y = 0 ; $ y < $ this ->moduleCount ; $ y ++){
71
70
$ r = [];
@@ -74,17 +73,19 @@ protected function text():string{
74
73
$ r [] = $ this ->getModuleValueAt ($ x , $ y );
75
74
}
76
75
77
- $ str [] = implode ('' , $ r );
76
+ $ lines [] = $ this -> options -> textLineStart . implode ('' , $ r );
78
77
}
79
78
80
- return implode ($ this ->options ->eol , $ str );
79
+ return implode ($ this ->options ->eol , $ lines );
81
80
}
82
81
83
82
/**
84
83
* JSON output
84
+ *
85
+ * @throws \JsonException
85
86
*/
86
87
protected function json ():string {
87
- return json_encode ($ this ->matrix ->getMatrix (), JSON_THROW_ON_ERROR );
88
+ return json_encode ($ this ->matrix ->getMatrix ($ this -> options -> jsonAsBooleans ), JSON_THROW_ON_ERROR );
88
89
}
89
90
90
91
//
Original file line number Diff line number Diff line change @@ -371,13 +371,22 @@ trait QROptionsTrait{
371
371
/**
372
372
* String substitute for dark
373
373
*/
374
- protected string $ textDark = '🔴 ' ;
374
+ protected string $ textDark = '██ ' ;
375
375
376
376
/**
377
377
* String substitute for light
378
378
*/
379
- protected string $ textLight = '⭕ ' ;
379
+ protected string $ textLight = '░░ ' ;
380
380
381
+ /**
382
+ * An optional line prefix, e.g. empty space to align the QR Code in a console
383
+ */
384
+ protected string $ textLineStart = '' ;
385
+
386
+ /**
387
+ * Whether to return matrix values in JSON as booleans or $M_TYPE integers
388
+ */
389
+ protected bool $ jsonAsBooleans = false ;
381
390
382
391
/*
383
392
* QRFpdf settings
You can’t perform that action at this time.
0 commit comments