Skip to content

Commit a78627d

Browse files
author
Corey McCormick
committed
Use protected methods over private in the helpers
1 parent 321120f commit a78627d

5 files changed

Lines changed: 27 additions & 27 deletions

File tree

src/SimpleSoftwareIO/QrCode/DataTypes/Email.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,28 @@ class Email implements DataTypeInterface
1111
*
1212
* @var string
1313
*/
14-
private $prefix = 'mailto:';
14+
protected $prefix = 'mailto:';
1515

1616
/**
1717
* The email address.
1818
*
1919
* @var string
2020
*/
21-
private $email;
21+
protected $email;
2222

2323
/**
2424
* The subject of the email.
2525
*
2626
* @var string
2727
*/
28-
private $subject;
28+
protected $subject;
2929

3030
/**
3131
* The body of an email.
3232
*
3333
* @var string
3434
*/
35-
private $body;
35+
protected $body;
3636

3737
/**
3838
* Generates the DataType Object and sets all of its properties.
@@ -59,7 +59,7 @@ public function __toString()
5959
*
6060
* @return string
6161
*/
62-
private function buildEmailString()
62+
protected function buildEmailString()
6363
{
6464
$email = $this->prefix.$this->email;
6565

@@ -79,7 +79,7 @@ private function buildEmailString()
7979
*
8080
* @param $arguments
8181
*/
82-
private function setProperties(array $arguments)
82+
protected function setProperties(array $arguments)
8383
{
8484
if (isset($arguments[0])) {
8585
$this->setEmail($arguments[0]);
@@ -97,7 +97,7 @@ private function setProperties(array $arguments)
9797
*
9898
* @param $email
9999
*/
100-
private function setEmail($email)
100+
protected function setEmail($email)
101101
{
102102
if ($this->isValidEmail($email)) {
103103
$this->email = $email;
@@ -111,7 +111,7 @@ private function setEmail($email)
111111
*
112112
* @return bool
113113
*/
114-
private function isValidEmail($email)
114+
protected function isValidEmail($email)
115115
{
116116
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
117117
throw new InvalidArgumentException('Invalid email provided');

src/SimpleSoftwareIO/QrCode/DataTypes/Geo.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ class Geo implements DataTypeInterface
99
*
1010
* @var string
1111
*/
12-
private $prefix = 'geo:';
12+
protected $prefix = 'geo:';
1313

1414
/**
1515
* The separator between the variables.
1616
*
1717
* @var string
1818
*/
19-
private $separator = ',';
19+
protected $separator = ',';
2020

2121
/**
2222
* The latitude.
@@ -30,7 +30,7 @@ class Geo implements DataTypeInterface
3030
*
3131
* @var
3232
*/
33-
private $longitude;
33+
protected $longitude;
3434

3535
/**
3636
* Generates the DataType Object and sets all of its properties.

src/SimpleSoftwareIO/QrCode/DataTypes/PhoneNumber.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ class PhoneNumber implements DataTypeInterface
99
*
1010
* @var string
1111
*/
12-
private $prefix = 'tel:';
12+
protected $prefix = 'tel:';
1313

1414
/**
1515
* The phone number.
1616
*
1717
* @var
1818
*/
19-
private $phoneNumber;
19+
protected $phoneNumber;
2020

2121
/**
2222
* Generates the DataType Object and sets all of its properties.

src/SimpleSoftwareIO/QrCode/DataTypes/SMS.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,28 @@ class SMS implements DataTypeInterface
99
*
1010
* @var string
1111
*/
12-
private $prefix = 'sms:';
12+
protected $prefix = 'sms:';
1313

1414
/**
1515
* The separator between the variables.
1616
*
1717
* @var string
1818
*/
19-
private $separator = ':';
19+
protected $separator = ':';
2020

2121
/**
2222
* The phone number.
2323
*
2424
* @var string
2525
*/
26-
private $phoneNumber;
26+
protected $phoneNumber;
2727

2828
/**
2929
* The SMS message.
3030
*
3131
* @var string
3232
*/
33-
private $message;
33+
protected $message;
3434

3535
/**
3636
* Generates the DataType Object and sets all of its properties.
@@ -57,7 +57,7 @@ public function __toString()
5757
*
5858
* @param array $arguments
5959
*/
60-
private function setProperties(array $arguments)
60+
protected function setProperties(array $arguments)
6161
{
6262
if (isset($arguments[0])) {
6363
$this->phoneNumber = $arguments[0];
@@ -72,7 +72,7 @@ private function setProperties(array $arguments)
7272
*
7373
* @return string
7474
*/
75-
private function buildSMSString()
75+
protected function buildSMSString()
7676
{
7777
$sms = $this->prefix.$this->phoneNumber;
7878

src/SimpleSoftwareIO/QrCode/DataTypes/WiFi.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,42 @@ class WiFi implements DataTypeInterface
99
*
1010
* @var string
1111
*/
12-
private $prefix = 'WIFI:';
12+
protected $prefix = 'WIFI:';
1313

1414
/**
1515
* The separator between the variables.
1616
*
1717
* @var string
1818
*/
19-
private $separator = ';';
19+
protected $separator = ';';
2020

2121
/**
2222
* The encryption of the network. WEP or WPA.
2323
*
2424
* @var string
2525
*/
26-
private $encryption;
26+
protected $encryption;
2727

2828
/**
2929
* The SSID of the WiFi network.
3030
*
3131
* @var string
3232
*/
33-
private $ssid;
33+
protected $ssid;
3434

3535
/**
3636
* The password of the network.
3737
*
3838
* @var string
3939
*/
40-
private $password;
40+
protected $password;
4141

4242
/**
4343
* Whether the network is a hidden SSID or not.
4444
*
4545
* @var bool
4646
*/
47-
private $hidden;
47+
protected $hidden;
4848

4949
/**
5050
* Generates the DataType Object and sets all of its properties.
@@ -71,7 +71,7 @@ public function __toString()
7171
*
7272
* @return string
7373
*/
74-
private function buildWifiString()
74+
protected function buildWifiString()
7575
{
7676
$wifi = $this->prefix;
7777

@@ -96,7 +96,7 @@ private function buildWifiString()
9696
*
9797
* @param $arguments
9898
*/
99-
private function setProperties(array $arguments)
99+
protected function setProperties(array $arguments)
100100
{
101101
$arguments = $arguments[0];
102102
if (isset($arguments['encryption'])) {

0 commit comments

Comments
 (0)