Skip to content

Commit 1836c37

Browse files
committed
PSR-2; Remove _ prefix on private class attributes
1 parent 19373ec commit 1836c37

1 file changed

Lines changed: 28 additions & 28 deletions

File tree

QRCode.class.php

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ class QRCode
1313
{
1414
const API_URL = 'https://chart.googleapis.com/chart?chs=';
1515

16-
private $_sData;
16+
private $sData;
1717

1818
/**
1919
* Constructor.
2020
*/
2121
public function __construct()
2222
{
23-
$this->_sData = 'BEGIN:VCARD' . "\n";
24-
$this->_sData .= 'VERSION:4.0' . "\n";
23+
$this->sData = 'BEGIN:VCARD' . "\n";
24+
$this->sData .= 'VERSION:4.0' . "\n";
2525
}
2626

2727
/**
@@ -33,7 +33,7 @@ public function __construct()
3333
*/
3434
public function name($sName)
3535
{
36-
$this->_sData .= 'N:' . $sName . "\n";
36+
$this->sData .= 'N:' . $sName . "\n";
3737
return $this;
3838
}
3939

@@ -46,7 +46,7 @@ public function name($sName)
4646
*/
4747
public function fullName($sFullName)
4848
{
49-
$this->_sData .= 'FN:' . $sFullName . "\n";
49+
$this->sData .= 'FN:' . $sFullName . "\n";
5050
return $this;
5151
}
5252

@@ -57,7 +57,7 @@ public function fullName($sFullName)
5757
*/
5858
public function address($sAddress)
5959
{
60-
$this->_sData .= 'ADR:' . $sAddress . "\n";
60+
$this->sData .= 'ADR:' . $sAddress . "\n";
6161

6262
return $this;
6363
}
@@ -69,7 +69,7 @@ public function address($sAddress)
6969
*/
7070
public function nickName($sNickname)
7171
{
72-
$this->_sData .= 'NICKNAME:' . $sNickname . "\n";
72+
$this->sData .= 'NICKNAME:' . $sNickname . "\n";
7373
return $this;
7474
}
7575

@@ -80,7 +80,7 @@ public function nickName($sNickname)
8080
*/
8181
public function email($sMail)
8282
{
83-
$this->_sData .= 'EMAIL;TYPE=PREF,INTERNET:' . $sMail . "\n";
83+
$this->sData .= 'EMAIL;TYPE=PREF,INTERNET:' . $sMail . "\n";
8484
return $this;
8585
}
8686

@@ -91,7 +91,7 @@ public function email($sMail)
9191
*/
9292
public function workPhone($sVal)
9393
{
94-
$this->_sData .= 'TEL;TYPE=WORK:' . $sVal . "\n";
94+
$this->sData .= 'TEL;TYPE=WORK:' . $sVal . "\n";
9595
return $this;
9696
}
9797

@@ -102,7 +102,7 @@ public function workPhone($sVal)
102102
*/
103103
public function homePhone($sVal)
104104
{
105-
$this->_sData .= 'TEL;TYPE=HOME:' . $sVal . "\n";
105+
$this->sData .= 'TEL;TYPE=HOME:' . $sVal . "\n";
106106
return $this;
107107
}
108108

@@ -114,7 +114,7 @@ public function homePhone($sVal)
114114
public function url($sUrl)
115115
{
116116
$sUrl = (substr($sUrl, 0, 4) != 'http') ? 'http://' . $sUrl : $sUrl;
117-
$this->_sData .= 'URL:' . $sUrl . "\n";
117+
$this->sData .= 'URL:' . $sUrl . "\n";
118118
return $this;
119119
}
120120

@@ -126,7 +126,7 @@ public function url($sUrl)
126126
*/
127127
public function sms($sPhone, $sText)
128128
{
129-
$this->_sData .= 'SMSTO:' . $sPhone . ':' . $sText . "\n";
129+
$this->sData .= 'SMSTO:' . $sPhone . ':' . $sText . "\n";
130130
return $this;
131131
}
132132

@@ -137,7 +137,7 @@ public function sms($sPhone, $sText)
137137
*/
138138
public function birthday($sBirthday)
139139
{
140-
$this->_sData .= 'BDAY:' . $sBirthday . "\n";
140+
$this->sData .= 'BDAY:' . $sBirthday . "\n";
141141
return $this;
142142
}
143143

@@ -148,7 +148,7 @@ public function birthday($sBirthday)
148148
*/
149149
public function anniversary($sBirthDate)
150150
{
151-
$this->_sData .= 'ANNIVERSARY:' . $sBirthDate . "\n";
151+
$this->sData .= 'ANNIVERSARY:' . $sBirthDate . "\n";
152152
return $this;
153153
}
154154

@@ -159,7 +159,7 @@ public function anniversary($sBirthDate)
159159
*/
160160
public function gender($sSex)
161161
{
162-
$this->_sData .= 'GENDER:' . $sSex . "\n";
162+
$this->sData .= 'GENDER:' . $sSex . "\n";
163163
return $this;
164164
}
165165

@@ -172,7 +172,7 @@ public function gender($sSex)
172172
*/
173173
public function categories($sCategories)
174174
{
175-
$this->_sData .= 'CATEGORIES:' . $sCategories . "\n";
175+
$this->sData .= 'CATEGORIES:' . $sCategories . "\n";
176176
return $this;
177177
}
178178

@@ -185,7 +185,7 @@ public function categories($sCategories)
185185
*/
186186
public function impp($sVal)
187187
{
188-
$this->_sData .= 'IMPP:' . $sVal . "\n";
188+
$this->sData .= 'IMPP:' . $sVal . "\n";
189189
return $this;
190190
}
191191

@@ -208,7 +208,7 @@ public function photo($sImgUrl)
208208
throw new InvalidArgumentException('Invalid format Image!');
209209
}
210210

211-
$this->_sData .= 'PHOTO;VALUE=URL;TYPE=' . $sExt . ':' . $sImgUrl . "\n";
211+
$this->sData .= 'PHOTO;VALUE=URL;TYPE=' . $sExt . ':' . $sImgUrl . "\n";
212212

213213
return $this;
214214
}
@@ -222,7 +222,7 @@ public function photo($sImgUrl)
222222
*/
223223
public function role($sRole)
224224
{
225-
$this->_sData .= 'ROLE:' . $sRole . "\n";
225+
$this->sData .= 'ROLE:' . $sRole . "\n";
226226
return $this;
227227
}
228228

@@ -239,7 +239,7 @@ public function role($sRole)
239239
*/
240240
public function organization($sOrg)
241241
{
242-
$this->_sData .= 'ORG:' . $sOrg . "\n";
242+
$this->sData .= 'ORG:' . $sOrg . "\n";
243243
return $this;
244244
}
245245

@@ -252,7 +252,7 @@ public function organization($sOrg)
252252
*/
253253
public function note($sText)
254254
{
255-
$this->_sData .= 'NOTE:' . $sText . "\n";
255+
$this->sData .= 'NOTE:' . $sText . "\n";
256256
return $this;
257257
}
258258

@@ -264,7 +264,7 @@ public function note($sText)
264264
*/
265265
public function bookmark($sTitle, $sUrl)
266266
{
267-
$this->_sData .= 'MEBKM:TITLE:' . $sTitle . ';URL:' . $sUrl . "\n";
267+
$this->sData .= 'MEBKM:TITLE:' . $sTitle . ';URL:' . $sUrl . "\n";
268268
return $this;
269269
}
270270

@@ -279,7 +279,7 @@ public function bookmark($sTitle, $sUrl)
279279
*/
280280
public function geo($sLat, $sLon, $iHeight)
281281
{
282-
$this->_sData .= 'GEO:' . $sLat . ',' . $sLon . ',' . $iHeight . "\n";
282+
$this->sData .= 'GEO:' . $sLat . ',' . $sLon . ',' . $iHeight . "\n";
283283
return $this;
284284
}
285285

@@ -292,7 +292,7 @@ public function geo($sLat, $sLon, $iHeight)
292292
*/
293293
public function lang($sLang)
294294
{
295-
$this->_sData .= 'LANG:' . $sLang . "\n";
295+
$this->sData .= 'LANG:' . $sLang . "\n";
296296
return $this;
297297
}
298298

@@ -305,7 +305,7 @@ public function lang($sLang)
305305
*/
306306
public function wifi($sType, $sSsid, $sPwd)
307307
{
308-
$this->_sData .= 'WIFI:T:' . $sType . ';S' . $sSsid . ';' . $sPwd . "\n";
308+
$this->sData .= 'WIFI:T:' . $sType . ';S' . $sSsid . ';' . $sPwd . "\n";
309309
return $this;
310310
}
311311

@@ -316,8 +316,8 @@ public function wifi($sType, $sSsid, $sPwd)
316316
*/
317317
public function finish()
318318
{
319-
$this->_sData .= 'END:VCARD';
320-
$this->_sData = urlencode($this->_sData);
319+
$this->sData .= 'END:VCARD';
320+
$this->sData = urlencode($this->sData);
321321
return $this;
322322
}
323323

@@ -332,7 +332,7 @@ public function finish()
332332
*/
333333
public function get($iSize = 150, $sECLevel = 'L', $iMargin = 1)
334334
{
335-
return self::API_URL . $iSize . 'x' . $iSize . '&cht=qr&chld=' . $sECLevel . '|' . $iMargin . '&chl=' . $this->_sData;
335+
return self::API_URL . $iSize . 'x' . $iSize . '&cht=qr&chld=' . $sECLevel . '|' . $iMargin . '&chl=' . $this->sData;
336336
}
337337

338338
/**

0 commit comments

Comments
 (0)