Generic URIs
A generic URI object League\Uri\Uri
is introduced to represent any RFC3986
compatible URI. This URI object wil only validate RFC3986 rules so depending on the URI scheme the returned URI may not be valid.
<?php
use League\Uri\Uri;
use League\Uri\Ws;
$ws_uri = 'wss://thephpleague.com/path/to?here#content';
$uri = Uri::createFromString($ws_uri);
//this will not throw an error because this URI satified RFC3986 rules
$uribis = Ws::createFromString($ws_uri);
//this will throw an exception because the URI contains a fragment which is forbidden
//for websocket URI