FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
simple-qrcode/src/DataTypes/SMS.php at develop · SimpleSoftwareIO/simple-qrcode · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
SimpleSoftwareIO
/
simple-qrcode
Public
Notifications
You must be signed in to change notification settings
Fork
458
Star
2.9k
Code
Issues
38
Pull requests
20
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
simple-qrcode
/
src
/
DataTypes
/
SMS.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
85 lines (74 loc) · 1.53 KB
Breadcrumbs
simple-qrcode
/
src
/
DataTypes
/
SMS.php
Copy path
File metadata and controls
85 lines (74 loc) · 1.53 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
namespace
SimpleSoftwareIO
\
QrCode
\
DataTypes
;
class
SMS
implements
DataTypeInterface
{
/**
* The prefix of the QrCode.
*
* @var string
*/
protected
$
prefix
=
'
sms:
'
;
/**
* The separator between the variables.
*
* @var string
*/
protected
$
separator
=
'
&body=
'
;
/**
* The phone number.
*
* @var string
*/
protected
$
phoneNumber
;
/**
* The SMS message.
*
* @var string
*/
protected
$
message
;
/**
* Generates the DataType Object and sets all of its properties.
*
* @param $arguments
*/
public
function
create
(
array
$
arguments
)
{
$
this
->
setProperties
(
$
arguments
);
}
/**
* Returns the correct QrCode format.
*
* @return string
*/
public
function
__toString
()
{
return
$
this
->
buildSMSString
();
}
/**
* Sets the phone number and message for a sms message.
*
* @param array $arguments
*/
protected
function
setProperties
(
array
$
arguments
)
{
if
(
isset
(
$
arguments
[
0
])) {
$
this
->
phoneNumber
=
$
arguments
[
0
];
}
if
(
isset
(
$
arguments
[
1
])) {
$
this
->
message
=
$
arguments
[
1
];
}
}
/**
* Builds a SMS string.
*
* @return string
*/
protected
function
buildSMSString
()
{
$
sms
=
$
this
->
prefix
.
$
this
->
phoneNumber
;
if
(
isset
(
$
this
->
message
)) {
$
sms
.=
$
this
->
separator
.
$
this
->
message
;
}
return
$
sms
;
}
}
Back
|
FazBrowse Home
|
New Git URL