:octocat: rename QROutputAbstract::base64encode() to toBase64DataURI() to better reflect what it does

This commit is contained in:
smiley
2022-07-28 00:13:45 +02:00
parent f15b0afe9d
commit 20de869bb9
7 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ class QRImageWithLogo extends QRGdImage{
}
if($this->options->imageBase64){
$imageData = $this->base64encode($imageData, 'image/'.$this->options->outputType);
$imageData = $this->toBase64DataURI($imageData, 'image/'.$this->options->outputType);
}
return $imageData;
+1 -1
View File
@@ -44,7 +44,7 @@ class QRImageWithText extends QRGdImage{
}
if($this->options->imageBase64){
$imageData = $this->base64encode($imageData, 'image/'.$this->options->outputType);
$imageData = $this->toBase64DataURI($imageData, 'image/'.$this->options->outputType);
}
return $imageData;
+1 -1
View File
@@ -57,7 +57,7 @@ class RoundQuietzoneSVGoutput extends QRMarkupSVG{
// transform to data URI only when not saving to file
if(!$saveToFile && $this->options->imageBase64){
$svg = $this->base64encode($svg, 'image/svg+xml');
$svg = $this->toBase64DataURI($svg, 'image/svg+xml');
}
return $svg;
+1 -1
View File
@@ -106,7 +106,7 @@ class QRFpdf extends QROutputAbstract{
}
if($this->options->imageBase64){
$pdfData = $this->base64encode($pdfData, 'application/pdf');
$pdfData = $this->toBase64DataURI($pdfData, 'application/pdf');
}
return $pdfData;
+1 -1
View File
@@ -131,7 +131,7 @@ class QRGdImage extends QROutputAbstract{
}
if($this->options->imageBase64){
$imageData = $this->base64encode($imageData, 'image/'.$this->options->outputType);
$imageData = $this->toBase64DataURI($imageData, 'image/'.$this->options->outputType);
}
restore_error_handler();
+1 -1
View File
@@ -40,7 +40,7 @@ class QRMarkupSVG extends QRMarkup{
// transform to data URI only when not saving to file
if(!$saveToFile && $this->options->imageBase64){
$svg = $this->base64encode($svg, 'image/svg+xml');
$svg = $this->toBase64DataURI($svg, 'image/svg+xml');
}
return $svg;
+1 -1
View File
@@ -117,7 +117,7 @@ abstract class QROutputAbstract implements QROutputInterface{
/**
* Returns a base64 data URI for the given string and mime type
*/
protected function base64encode(string $data, string $mime):string{
protected function toBase64DataURI(string $data, string $mime):string{
return sprintf('data:%s;base64,%s', $mime, base64_encode($data));
}