independent-analytics
/
vendor
/
league
/
uri-interfaces
/
src
/
Contracts
/
UriComponentInterface.php
AuthorityInterface.php
2 years ago
DataPathInterface.php
2 years ago
DomainHostInterface.php
2 years ago
FragmentInterface.php
2 years ago
HostInterface.php
2 years ago
IpHostInterface.php
2 years ago
PathInterface.php
2 years ago
PortInterface.php
2 years ago
QueryInterface.php
2 years ago
SegmentedPathInterface.php
2 years ago
UriComponentInterface.php
2 years ago
UriException.php
2 years ago
UriInterface.php
2 years ago
UserInfoInterface.php
2 years ago
UriComponentInterface.php
83 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * League.Uri (https://uri.thephpleague.com) |
| 5 | * |
| 6 | * (c) Ignace Nyamagana Butera <nyamsprod@gmail.com> |
| 7 | * |
| 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | * file that was distributed with this source code. |
| 10 | */ |
| 11 | declare (strict_types=1); |
| 12 | namespace IAWPSCOPED\League\Uri\Contracts; |
| 13 | |
| 14 | use IAWPSCOPED\League\Uri\Exceptions\IdnSupportMissing; |
| 15 | use IAWPSCOPED\League\Uri\Exceptions\SyntaxError; |
| 16 | /** @internal */ |
| 17 | interface UriComponentInterface extends \JsonSerializable |
| 18 | { |
| 19 | /** |
| 20 | * Returns the instance content. |
| 21 | * |
| 22 | * If the instance is defined, the value returned MUST be encoded according to the |
| 23 | * selected encoding algorithm. In any case, the value MUST NOT double-encode any character |
| 24 | * depending on the selected encoding algorithm. |
| 25 | * |
| 26 | * To determine what characters to encode, please refer to RFC 3986, Sections 2 and 3. |
| 27 | * or RFC 3987 Section 3. By default the content is encoded according to RFC3986 |
| 28 | * |
| 29 | * If the instance is not defined null is returned |
| 30 | */ |
| 31 | public function getContent() : ?string; |
| 32 | /** |
| 33 | * Returns the instance string representation. |
| 34 | * |
| 35 | * If the instance is defined, the value returned MUST be percent-encoded, |
| 36 | * but MUST NOT double-encode any characters. To determine what characters |
| 37 | * to encode, please refer to RFC 3986, Sections 2 and 3. |
| 38 | * |
| 39 | * If the instance is not defined an empty string is returned |
| 40 | */ |
| 41 | public function __toString() : string; |
| 42 | /** |
| 43 | * Returns the instance json representation. |
| 44 | * |
| 45 | * If the instance is defined, the value returned MUST be percent-encoded, |
| 46 | * but MUST NOT double-encode any characters. To determine what characters |
| 47 | * to encode, please refer to RFC 3986 or RFC 1738. |
| 48 | * |
| 49 | * If the instance is not defined null is returned |
| 50 | */ |
| 51 | public function jsonSerialize() : ?string; |
| 52 | /** |
| 53 | * Returns the instance string representation with its optional URI delimiters. |
| 54 | * |
| 55 | * The value returned MUST be percent-encoded, but MUST NOT double-encode any |
| 56 | * characters. To determine what characters to encode, please refer to RFC 3986, |
| 57 | * Sections 2 and 3. |
| 58 | * |
| 59 | * If the instance is not defined an empty string is returned |
| 60 | */ |
| 61 | public function getUriComponent() : string; |
| 62 | /** |
| 63 | * Returns an instance with the specified content. |
| 64 | * |
| 65 | * This method MUST retain the state of the current instance, and return |
| 66 | * an instance that contains the specified content. |
| 67 | * |
| 68 | * Users can provide both encoded and decoded content characters. |
| 69 | * |
| 70 | * A null value is equivalent to removing the component content. |
| 71 | * |
| 72 | * |
| 73 | * @param ?string $content |
| 74 | * |
| 75 | * @throws SyntaxError for invalid component or transformations |
| 76 | * that would result in a object in invalid state. |
| 77 | * @throws IdnSupportMissing for component or transformations |
| 78 | * requiring IDN support when IDN support is not present |
| 79 | * or misconfigured. |
| 80 | */ |
| 81 | public function withContent(?string $content) : self; |
| 82 | } |
| 83 |