@@ -38,17 +38,17 @@ class Host
38
38
/**
39
39
* Public constructor.
40
40
*
41
- * @param string|null $subdomain Subdomain portion of host
41
+ * @param string|null $subdomain Subdomain portion of host
42
42
* @param string|null $registrableDomain Registrable domain portion of host
43
- * @param string|null $publicSuffix Public suffix portion of host
44
- * @param string $host OPTIONAL Entire host part
43
+ * @param string|null $publicSuffix Public suffix portion of host
44
+ * @param string $host OPTIONAL Entire host part
45
45
*/
46
- public function __construct ( $ subdomain , $ registrableDomain , $ publicSuffix , $ host = null )
46
+ public function __construct ($ subdomain , $ registrableDomain , $ publicSuffix , $ host = null )
47
47
{
48
- $ this ->subdomain = $ subdomain ;
49
- $ this ->registrableDomain = $ registrableDomain ;
50
- $ this ->publicSuffix = $ publicSuffix ;
51
- $ this ->host = $ host ;
48
+ $ this ->subdomain = $ subdomain ;
49
+ $ this ->registrableDomain = $ registrableDomain ;
50
+ $ this ->publicSuffix = $ publicSuffix ;
51
+ $ this ->host = $ host ;
52
52
}
53
53
54
54
/**
@@ -64,7 +64,7 @@ public function getSubdomain()
64
64
/**
65
65
* @param string $subdomain
66
66
*/
67
- public function setSubdomain ( $ subdomain )
67
+ public function setSubdomain ( $ subdomain )
68
68
{
69
69
$ this ->subdomain = $ subdomain ;
70
70
}
@@ -80,7 +80,7 @@ public function getRegistrableDomain()
80
80
/**
81
81
* @param string $registrableDomain
82
82
*/
83
- public function setRegistrableDomain ( $ registrableDomain )
83
+ public function setRegistrableDomain ($ registrableDomain )
84
84
{
85
85
$ this ->registrableDomain = $ registrableDomain ;
86
86
}
@@ -98,7 +98,7 @@ public function getPublicSuffix()
98
98
/**
99
99
* @param string $publicSuffix
100
100
*/
101
- public function setPublicSuffix ( $ publicSuffix )
101
+ public function setPublicSuffix ($ publicSuffix )
102
102
{
103
103
$ this ->publicSuffix = $ publicSuffix ;
104
104
}
@@ -116,7 +116,7 @@ public function getHost()
116
116
/**
117
117
* @param string $host
118
118
*/
119
- public function setHost ( $ host )
119
+ public function setHost ($ host )
120
120
{
121
121
$ this ->host = $ host ;
122
122
}
@@ -128,18 +128,17 @@ public function setHost( $host )
128
128
*/
129
129
public function __toString ()
130
130
{
131
- if ( $ this ->host !== null )
132
- {
131
+ if ($ this ->host !== null ) {
133
132
return $ this ->host ;
134
133
}
135
134
136
135
// retain only the elements that are not empty
137
136
$ str = array_filter (
138
- array ( $ this ->subdomain , $ this ->registrableDomain ),
137
+ array ($ this ->subdomain , $ this ->registrableDomain ),
139
138
'strlen '
140
139
);
141
140
142
- return implode ( '. ' , $ str );
141
+ return implode ('. ' , $ str );
143
142
}
144
143
145
144
/**
@@ -150,10 +149,10 @@ public function __toString()
150
149
public function toArray ()
151
150
{
152
151
return array (
153
- 'subdomain ' => $ this ->subdomain ,
154
- 'registrableDomain ' => $ this ->registrableDomain ,
155
- 'publicSuffix ' => $ this ->publicSuffix ,
156
- 'host ' => $ this ->host ,
152
+ 'subdomain ' => $ this ->subdomain ,
153
+ 'registrableDomain ' => $ this ->registrableDomain ,
154
+ 'publicSuffix ' => $ this ->publicSuffix ,
155
+ 'host ' => $ this ->host ,
157
156
);
158
157
}
159
158
}
0 commit comments