Skip to content

Commit 12b2a29

Browse files
committed
Document URL::parse()
1 parent b18f073 commit 12b2a29

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ The `hash` getter, also known as a URLs fragment, returns the portion of the URL
125125

126126
A static method that allows the user to quickly check if a URL is parsable, without needing to construct a new URL object and wrapping it with a try/catch statement.
127127

128+
#### `?\Rowbot\URL\URL URL::parse(string|\Stringable $url, null|string|\Stringable $base = null)`
129+
130+
A static method that allows the user to parse a string in a way that does not throw exceptions like with the constructor object.
131+
128132
#### `string URL::toJSON()`
129133

130134
Returns a JSON encoded string of the URL. Note that this method escapes forward slashes, which is not the default for PHPs `json_encode()`, but matches the default behavior of JavaScripts `JSON.stringify()`. If you wish to control the serialization, then pass the URL obect to the `json_encode()` function.

0 commit comments

Comments
 (0)