Skip to content

Commit 20de869

Browse files
committed
:octocat: rename QROutputAbstract::base64encode() to toBase64DataURI() to better reflect what it does
1 parent f15b0af commit 20de869

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

examples/imageWithLogo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function dump(string $file = null, string $logo = null):string{
6464
}
6565

6666
if($this->options->imageBase64){
67-
$imageData = $this->base64encode($imageData, 'image/'.$this->options->outputType);
67+
$imageData = $this->toBase64DataURI($imageData, 'image/'.$this->options->outputType);
6868
}
6969

7070
return $imageData;

examples/imageWithText.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function dump(string $file = null, string $text = null):string{
4444
}
4545

4646
if($this->options->imageBase64){
47-
$imageData = $this->base64encode($imageData, 'image/'.$this->options->outputType);
47+
$imageData = $this->toBase64DataURI($imageData, 'image/'.$this->options->outputType);
4848
}
4949

5050
return $imageData;

examples/svgRoundQuietzone.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected function createMarkup(bool $saveToFile):string{
5757

5858
// transform to data URI only when not saving to file
5959
if(!$saveToFile && $this->options->imageBase64){
60-
$svg = $this->base64encode($svg, 'image/svg+xml');
60+
$svg = $this->toBase64DataURI($svg, 'image/svg+xml');
6161
}
6262

6363
return $svg;

src/Output/QRFpdf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function dump(string $file = null){
106106
}
107107

108108
if($this->options->imageBase64){
109-
$pdfData = $this->base64encode($pdfData, 'application/pdf');
109+
$pdfData = $this->toBase64DataURI($pdfData, 'application/pdf');
110110
}
111111

112112
return $pdfData;

src/Output/QRGdImage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function dump(string $file = null){
131131
}
132132

133133
if($this->options->imageBase64){
134-
$imageData = $this->base64encode($imageData, 'image/'.$this->options->outputType);
134+
$imageData = $this->toBase64DataURI($imageData, 'image/'.$this->options->outputType);
135135
}
136136

137137
restore_error_handler();

src/Output/QRMarkupSVG.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ protected function createMarkup(bool $saveToFile):string{
4040

4141
// transform to data URI only when not saving to file
4242
if(!$saveToFile && $this->options->imageBase64){
43-
$svg = $this->base64encode($svg, 'image/svg+xml');
43+
$svg = $this->toBase64DataURI($svg, 'image/svg+xml');
4444
}
4545

4646
return $svg;

src/Output/QROutputAbstract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ abstract protected function getDefaultModuleValue(bool $isDark);
117117
/**
118118
* Returns a base64 data URI for the given string and mime type
119119
*/
120-
protected function base64encode(string $data, string $mime):string{
120+
protected function toBase64DataURI(string $data, string $mime):string{
121121
return sprintf('data:%s;base64,%s', $mime, base64_encode($data));
122122
}
123123

0 commit comments

Comments
 (0)