1414
1515final class Uri implements UriInterface
1616{
17- /**
18- * @var non-empty-string
19- */
20- public const string URI_SCHEMA_SUFFIX = ': ' ;
21-
22- /**
23- * @var non-empty-string
24- */
25- public const string URI_AUTHORITY_PREFIX = '// ' ;
26-
27- /**
28- * @var non-empty-string
29- */
30- public const string URI_QUERY_PREFIX = '? ' ;
31-
32- /**
33- * @var non-empty-string
34- */
35- public const string URI_FRAGMENT_PREFIX = '# ' ;
36-
3717 /**
3818 * Gets the user component of the URI.
3919 *
40- * @uses \Boson\Contracts\Uri\Component\UserInfoInterface::$user
41- *
4220 * @var non-empty-string|null
4321 */
4422 public ?string $ user {
@@ -48,8 +26,6 @@ final class Uri implements UriInterface
4826 /**
4927 * Gets the password component of the URI.
5028 *
51- * @uses \Boson\Contracts\Uri\Component\UserInfoInterface::$password
52- *
5329 * @var non-empty-string|null
5430 */
5531 public ?string $ password {
@@ -59,8 +35,6 @@ final class Uri implements UriInterface
5935 /**
6036 * Gets the host component of the URI.
6137 *
62- * @uses \Boson\Contracts\Uri\Component\AuthorityInterface::$host
63- *
6438 * @var non-empty-string|null
6539 */
6640 public ?string $ host {
@@ -70,8 +44,6 @@ final class Uri implements UriInterface
7044 /**
7145 * Gets the port component of the URI.
7246 *
73- * @uses \Boson\Contracts\Uri\Component\AuthorityInterface::$port
74- *
7547 * @var int<0, 65535>|null
7648 */
7749 public ?int $ port {
@@ -116,22 +88,21 @@ public function __toString(): string
11688 $ result = '' ;
11789
11890 if ($ this ->scheme !== null ) {
119- $ result .= $ this ->scheme . self :: URI_SCHEMA_SUFFIX ;
91+ $ result .= $ this ->scheme . ' : ' ;
12092 }
12193
12294 if ($ this ->authority !== null ) {
123- $ result .= self ::URI_AUTHORITY_PREFIX
124- . $ this ->authority ;
95+ $ result .= '// ' . $ this ->authority ;
12596 }
12697
12798 $ result .= $ this ->path ;
12899
129100 if ($ this ->query ->count () !== 0 ) {
130- $ result .= self :: URI_QUERY_PREFIX . $ this ->query ;
101+ $ result .= ' ? ' . $ this ->query ;
131102 }
132103
133104 if ($ this ->fragment !== null ) {
134- $ result .= self :: URI_FRAGMENT_PREFIX . \rawurlencode ($ this ->fragment );
105+ $ result .= ' # ' . \rawurlencode ($ this ->fragment );
135106 }
136107
137108 return $ result ;
0 commit comments