Skip to content

Commit e554a9b

Browse files
committed
change all $qrtext to camelCase version
1 parent 9bc454f commit e554a9b

9 files changed

+32
-32
lines changed

lib/Providers/Qr/BaconQrCodeProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ public function getMimeType(): string
5151
throw new RuntimeException(sprintf('Unknown MIME-type: %s', $this->format));
5252
}
5353

54-
public function getQRCodeImage(string $qrtext, int $size): string
54+
public function getQRCodeImage(string $qrText, int $size): string
5555
{
5656
$backend = match ($this->format) {
5757
'svg' => new SvgImageBackEnd(),
5858
'eps' => new EpsImageBackEnd(),
5959
default => new ImagickImageBackEnd($this->format),
6060
};
6161

62-
$output = $this->getQRCodeByBackend($qrtext, $size, $backend);
62+
$output = $this->getQRCodeByBackend($qrText, $size, $backend);
6363

6464
if ($this->format === 'svg') {
6565
$svg = explode("\n", $output);

lib/Providers/Qr/EndroidQrCodeProvider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ public function getMimeType(): string
4141
return 'image/png';
4242
}
4343

44-
public function getQRCodeImage(string $qrtext, int $size): string
44+
public function getQRCodeImage(string $qrText, int $size): string
4545
{
4646
if (!$this->endroid4) {
47-
return $this->qrCodeInstance($qrtext, $size)->writeString();
47+
return $this->qrCodeInstance($qrText, $size)->writeString();
4848
}
4949

5050
$writer = new PngWriter();
51-
return $writer->write($this->qrCodeInstance($qrtext, $size))->getString();
51+
return $writer->write($this->qrCodeInstance($qrText, $size))->getString();
5252
}
5353

54-
protected function qrCodeInstance(string $qrtext, int $size): QrCode
54+
protected function qrCodeInstance(string $qrText, int $size): QrCode
5555
{
56-
$qrCode = new QrCode($qrtext);
56+
$qrCode = new QrCode($qrText);
5757
$qrCode->setSize($size);
5858

5959
$qrCode->setErrorCorrectionLevel($this->errorcorrectionlevel);

lib/Providers/Qr/EndroidQrCodeWithLogoProvider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ public function setLogo($path, $size = null)
2525
$this->logoSize = (array)$size;
2626
}
2727

28-
public function getQRCodeImage(string $qrtext, int $size): string
28+
public function getQRCodeImage(string $qrText, int $size): string
2929
{
3030
if (!$this->endroid4) {
31-
return $this->qrCodeInstance($qrtext, $size)->writeString();
31+
return $this->qrCodeInstance($qrText, $size)->writeString();
3232
}
3333

3434
$logo = null;
@@ -42,12 +42,12 @@ public function getQRCodeImage(string $qrtext, int $size): string
4242
}
4343
}
4444
$writer = new PngWriter();
45-
return $writer->write($this->qrCodeInstance($qrtext, $size), $logo)->getString();
45+
return $writer->write($this->qrCodeInstance($qrText, $size), $logo)->getString();
4646
}
4747

48-
protected function qrCodeInstance(string $qrtext, int $size): QrCode
48+
protected function qrCodeInstance(string $qrText, int $size): QrCode
4949
{
50-
$qrCode = parent::qrCodeInstance($qrtext, $size);
50+
$qrCode = parent::qrCodeInstance($qrText, $size);
5151

5252
if (!$this->endroid4 && $this->logoPath) {
5353
$qrCode->setLogoPath($this->logoPath);

lib/Providers/Qr/GoogleChartsQrCodeProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ public function getMimeType(): string
1616
return 'image/png';
1717
}
1818

19-
public function getQRCodeImage(string $qrtext, int $size): string
19+
public function getQRCodeImage(string $qrText, int $size): string
2020
{
21-
return $this->getContent($this->getUrl($qrtext, $size));
21+
return $this->getContent($this->getUrl($qrText, $size));
2222
}
2323

24-
public function getUrl(string $qrtext, int $size): string
24+
public function getUrl(string $qrText, int $size): string
2525
{
2626
$queryParameters = array(
2727
'chs' => $size . 'x' . $size,
2828
'chld' => strtoupper($this->errorcorrectionlevel) . '|' . $this->margin,
2929
'cht' => 'qr',
3030
'choe' => $this->encoding,
31-
'chl' => $qrtext,
31+
'chl' => $qrText,
3232
);
3333

3434
return 'https://chart.googleapis.com/chart?' . http_build_query($queryParameters);

lib/Providers/Qr/IQRCodeProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ interface IQRCodeProvider
99
/**
1010
* Generate and return the QR code to embed in a web page
1111
*
12-
* @param string $qrtext the value to encode in the QR code
12+
* @param string $qrText the value to encode in the QR code
1313
* @param int $size the desired size of the QR code
1414
*
1515
* @return string file contents of the QR code
1616
*/
17-
public function getQRCodeImage(string $qrtext, int $size): string;
17+
public function getQRCodeImage(string $qrText, int $size): string;
1818

1919
/**
2020
* Returns the appropriate mime type for the QR code

lib/Providers/Qr/ImageChartsQRCodeProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ public function getMimeType(): string
1818
return 'image/png';
1919
}
2020

21-
public function getQRCodeImage(string $qrtext, int $size): string
21+
public function getQRCodeImage(string $qrText, int $size): string
2222
{
23-
return $this->getContent($this->getUrl($qrtext, $size));
23+
return $this->getContent($this->getUrl($qrText, $size));
2424
}
2525

26-
public function getUrl(string $qrtext, int $size): string
26+
public function getUrl(string $qrText, int $size): string
2727
{
2828
$queryParameters = array(
2929
'cht' => 'qr',
3030
'chs' => ceil($size / 2) . 'x' . ceil($size / 2),
3131
'chld' => $this->errorcorrectionlevel . '|' . $this->margin,
32-
'chl' => $qrtext,
32+
'chl' => $qrText,
3333
);
3434

3535
return 'https://image-charts.com/chart?' . http_build_query($queryParameters);

lib/Providers/Qr/QRServerProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ public function getMimeType(): string
3131
throw new QRException(sprintf('Unknown MIME-type: %s', $this->format));
3232
}
3333

34-
public function getQRCodeImage(string $qrtext, int $size): string
34+
public function getQRCodeImage(string $qrText, int $size): string
3535
{
36-
return $this->getContent($this->getUrl($qrtext, $size));
36+
return $this->getContent($this->getUrl($qrText, $size));
3737
}
3838

39-
public function getUrl(string $qrtext, int $size): string
39+
public function getUrl(string $qrText, int $size): string
4040
{
4141
$queryParameters = array(
4242
'size' => $size . 'x' . $size,
@@ -46,7 +46,7 @@ public function getUrl(string $qrtext, int $size): string
4646
'bgcolor' => $this->decodeColor($this->bgcolor),
4747
'color' => $this->decodeColor($this->color),
4848
'format' => strtolower($this->format),
49-
'data' => $qrtext,
49+
'data' => $qrText,
5050
);
5151

5252
return 'https://api.qrserver.com/v1/create-qr-code/?' . http_build_query($queryParameters);

lib/Providers/Qr/QRicketProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ public function getMimeType(): string
2727
throw new QRException(sprintf('Unknown MIME-type: %s', $this->format));
2828
}
2929

30-
public function getQRCodeImage(string $qrtext, int $size): string
30+
public function getQRCodeImage(string $qrText, int $size): string
3131
{
32-
return $this->getContent($this->getUrl($qrtext, $size));
32+
return $this->getContent($this->getUrl($qrText, $size));
3333
}
3434

35-
public function getUrl(string $qrtext, int $size): string
35+
public function getUrl(string $qrText, int $size): string
3636
{
3737
$queryParameters = array(
3838
'qrsize' => $size,
3939
'e' => strtolower($this->errorcorrectionlevel),
4040
'bgdcolor' => $this->bgcolor,
4141
'fgdcolor' => $this->color,
4242
't' => strtolower($this->format),
43-
'd' => $qrtext,
43+
'd' => $qrText,
4444
);
4545

4646
return 'http://qrickit.com/api/qr?' . http_build_query($queryParameters);

tests/Providers/Qr/TestQrProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
class TestQrProvider implements IQRCodeProvider
1010
{
11-
public function getQRCodeImage(string $qrtext, int $size): string
11+
public function getQRCodeImage(string $qrText, int $size): string
1212
{
13-
return $qrtext . '@' . $size;
13+
return $qrText . '@' . $size;
1414
}
1515

1616
public function getMimeType(): string

0 commit comments

Comments
 (0)