@@ -10,8 +10,6 @@ class EndroidQrCodeProvider implements IQRCodeProvider
10
10
public $ color ;
11
11
public $ margin ;
12
12
public $ errorcorrectionlevel ;
13
- protected $ logoPath ;
14
- protected $ logoSize ;
15
13
16
14
public function __construct ($ bgcolor = 'ffffff ' , $ color = '000000 ' , $ margin = 0 , $ errorcorrectionlevel = 'H ' )
17
15
{
@@ -21,23 +19,17 @@ public function __construct($bgcolor = 'ffffff', $color = '000000', $margin = 0,
21
19
$ this ->errorcorrectionlevel = $ this ->handleErrorCorrectionLevel ($ errorcorrectionlevel );
22
20
}
23
21
24
- /**
25
- * Adds an image to the middle of the QR Code.
26
- * @param string $path Path to an image file
27
- * @param array|int $size Just the width, or [width, height]
28
- */
29
- public function setLogo ($ path , $ size = null )
30
- {
31
- $ this ->logoPath = $ path ;
32
- $ this ->logoSize = (array )$ size ;
33
- }
34
-
35
22
public function getMimeType ()
36
23
{
37
24
return 'image/png ' ;
38
25
}
39
26
40
27
public function getQRCodeImage ($ qrtext , $ size )
28
+ {
29
+ return $ this ->qrCodeInstance ($ qrtext , $ size )->writeString ();
30
+ }
31
+
32
+ protected function qrCodeInstance ($ qrtext , $ size )
41
33
{
42
34
$ qrCode = new QrCode ($ qrtext );
43
35
$ qrCode ->setSize ($ size );
@@ -47,14 +39,7 @@ public function getQRCodeImage($qrtext, $size)
47
39
$ qrCode ->setBackgroundColor ($ this ->bgcolor );
48
40
$ qrCode ->setForegroundColor ($ this ->color );
49
41
50
- if ($ this ->logoPath ) {
51
- $ qrCode ->setLogoPath ($ this ->logoPath );
52
- if ($ this ->logoSize ) {
53
- $ qrCode ->setLogoSize ($ this ->logoSize [0 ], $ this ->logoSize [1 ]);
54
- }
55
- }
56
-
57
- return $ qrCode ->writeString ();
42
+ return $ qrCode ;
58
43
}
59
44
60
45
private function handleColor ($ color )
0 commit comments