@@ -71,18 +71,18 @@ class SiteURI extends URI
7171 private string $ routePath ;
7272
7373 /**
74- * @param string $relativePath URI path relative to baseURL. May include
75- * queries or fragments.
76- * @param string $host Optional hostname. If it is not in $allowedHostnames,
77- * just be ignored.
78- * @param string $scheme Optional scheme. 'http' or 'https'.
79- * @phpstan-param 'http'|'https'|'' $scheme
74+ * @param string $relativePath URI path relative to baseURL. May include
75+ * queries or fragments.
76+ * @param string|null $host Optional hostname. If it is not in
77+ * $allowedHostnames, just be ignored.
78+ * @param string|null $scheme Optional scheme. 'http' or 'https'.
79+ * @phpstan-param 'http'|'https'|null $scheme
8080 */
8181 public function __construct (
8282 App $ configApp ,
8383 string $ relativePath = '' ,
84- string $ host = '' ,
85- string $ scheme = ''
84+ ? string $ host = null ,
85+ ? string $ scheme = null
8686 ) {
8787 $ this ->baseURL = $ this ->normalizeBaseURL ($ configApp );
8888 $ this ->indexPage = $ configApp ->indexPage ;
@@ -106,14 +106,14 @@ public function __construct(
106106 $ uri = new URI ($ tempUri );
107107
108108 // Update scheme
109- if ($ scheme !== '' ) {
109+ if ($ scheme !== null ) {
110110 $ uri ->setScheme ($ scheme );
111111 } elseif ($ configApp ->forceGlobalSecureRequests ) {
112112 $ uri ->setScheme ('https ' );
113113 }
114114
115115 // Update host
116- if ($ host !== '' && $ this ->checkHost ($ host , $ configApp ->allowedHostnames )) {
116+ if ($ host !== null && $ this ->checkHost ($ host , $ configApp ->allowedHostnames )) {
117117 $ uri ->setHost ($ host );
118118 }
119119
0 commit comments