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{
2020 * @inheritDoc
2121 */
2222 public function dump (string $ file = null ):string {
23- $ data = $ this ->createMarkup ($ file !== null );
23+ $ saveToFile = $ file !== null ;
24+ $ data = $ this ->createMarkup ($ saveToFile );
2425
2526 $ this ->saveToFile ($ data , $ file );
2627
28+ // transform to data URI only when not saving to file
29+ if (!$ saveToFile && $ this ->options ->outputBase64 ){
30+ return $ this ->toBase64DataURI ($ data );
31+ }
32+
2733 return $ data ;
2834 }
2935
Original file line number Diff line number Diff line change @@ -83,11 +83,6 @@ protected function createMarkup(bool $saveToFile):string{
8383 // close svg
8484 $ svg .= sprintf ('%1$s</svg>%1$s ' , $ this ->eol );
8585
86- // transform to data URI only when not saving to file
87- if (!$ saveToFile && $ this ->options ->outputBase64 ){
88- return $ this ->toBase64DataURI ($ svg );
89- }
90-
9186 return $ svg ;
9287 }
9388
Original file line number Diff line number Diff line change @@ -61,11 +61,6 @@ protected function createMarkup(bool $saveToFile):string{
6161
6262 $ xml = $ this ->dom ->saveXML ();
6363
64- // transform to data URI only when not saving to file
65- if (!$ saveToFile && $ this ->options ->outputBase64 ){
66- return $ this ->toBase64DataURI ($ xml );
67- }
68-
6964 return $ xml ;
7065 }
7166
You can’t perform that action at this time.
0 commit comments