@@ -96,10 +96,15 @@ public static function getPath( string $name ) : string {
96
96
throw new WP2StaticException ( $ err );
97
97
}
98
98
99
+ /**
100
+ * @var string $original_path
101
+ */
102
+ $ original_path = self ::$ info [ $ key ];
103
+
99
104
// Standardise all paths to use / (Windows support)
100
- $ path = str_replace ( '\\' , '/ ' , self :: $ info [ $ key ] );
105
+ $ standardised_path = str_replace ( '\\' , '/ ' , $ original_path );
101
106
102
- return $ path ;
107
+ return $ standardised_path ;
103
108
}
104
109
105
110
/**
@@ -120,7 +125,12 @@ public static function getUrl( string $name ) : string {
120
125
throw new WP2StaticException ( $ err );
121
126
}
122
127
123
- return self ::$ info [ $ key ];
128
+ /**
129
+ * @var string $url
130
+ */
131
+ $ url = self ::$ info [ $ key ];
132
+
133
+ return $ url ;
124
134
}
125
135
126
136
// TODO Use WP_Http 'curl_enabled' => $this->hasCurlSupport(),
@@ -138,7 +148,11 @@ public static function isUploadsWritable() : bool {
138
148
self ::$ instance = new SiteInfo ();
139
149
}
140
150
151
+ /**
152
+ * @var string $uploads_dir
153
+ */
141
154
$ uploads_dir = self ::$ info ['uploads_path ' ];
155
+
142
156
return file_exists ( $ uploads_dir ) && is_writeable ( $ uploads_dir );
143
157
}
144
158
@@ -147,6 +161,9 @@ public static function permalinksAreCompatible() : bool {
147
161
self ::$ instance = new SiteInfo ();
148
162
}
149
163
164
+ /**
165
+ * @var string $structure
166
+ */
150
167
$ structure = get_option ( 'permalink_structure ' );
151
168
152
169
return strlen ( $ structure ) && 0 === strcmp ( $ structure [-1 ], '/ ' );
@@ -157,7 +174,12 @@ public static function getPermalinks() : string {
157
174
self ::$ instance = new SiteInfo ();
158
175
}
159
176
160
- return get_option ( 'permalink_structure ' );
177
+ /**
178
+ * @var string $permalink_structure
179
+ */
180
+ $ permalink_structure = get_option ( 'permalink_structure ' );
181
+
182
+ return $ permalink_structure ;
161
183
}
162
184
163
185
/**
@@ -170,7 +192,12 @@ public static function getSiteURLHost() : string {
170
192
self ::$ instance = new SiteInfo ();
171
193
}
172
194
173
- $ url_host = parse_url ( self ::$ info ['site_url ' ], PHP_URL_HOST );
195
+ /**
196
+ * @var string $site_url
197
+ */
198
+ $ site_url = self ::$ info ['site_url ' ];
199
+
200
+ $ url_host = parse_url ( $ site_url , PHP_URL_HOST );
174
201
175
202
if ( ! is_string ( $ url_host ) ) {
176
203
$ err = 'Failed to get hostname from Site URL ' ;
0 commit comments