File tree Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,16 @@ abstract class QRMarkup extends QROutputAbstract{
20
20
* @inheritDoc
21
21
*/
22
22
public function dump (string $ file = null ):string {
23
- $ data = $ this ->createMarkup ($ file !== null );
23
+ $ saveToFile = $ file !== null ;
24
+ $ data = $ this ->createMarkup ($ saveToFile );
24
25
25
26
$ this ->saveToFile ($ data , $ file );
26
27
28
+ // transform to data URI only when not saving to file
29
+ if (!$ saveToFile && $ this ->options ->outputBase64 ){
30
+ return $ this ->toBase64DataURI ($ data );
31
+ }
32
+
27
33
return $ data ;
28
34
}
29
35
Original file line number Diff line number Diff line change @@ -83,11 +83,6 @@ protected function createMarkup(bool $saveToFile):string{
83
83
// close svg
84
84
$ svg .= sprintf ('%1$s</svg>%1$s ' , $ this ->eol );
85
85
86
- // transform to data URI only when not saving to file
87
- if (!$ saveToFile && $ this ->options ->outputBase64 ){
88
- return $ this ->toBase64DataURI ($ svg );
89
- }
90
-
91
86
return $ svg ;
92
87
}
93
88
Original file line number Diff line number Diff line change @@ -61,11 +61,6 @@ protected function createMarkup(bool $saveToFile):string{
61
61
62
62
$ xml = $ this ->dom ->saveXML ();
63
63
64
- // transform to data URI only when not saving to file
65
- if (!$ saveToFile && $ this ->options ->outputBase64 ){
66
- return $ this ->toBase64DataURI ($ xml );
67
- }
68
-
69
64
return $ xml ;
70
65
}
71
66
You can’t perform that action at this time.
0 commit comments