|
| 1 | +<?php |
| 2 | + |
| 3 | +/** |
| 4 | + * League.Uri (https://uri.thephpleague.com) |
| 5 | + * |
| 6 | + * (c) Ignace Nyamagana Butera <[email protected]> |
| 7 | + * |
| 8 | + * For the full copyright and license information, please view the LICENSE |
| 9 | + * file that was distributed with this source code. |
| 10 | + */ |
| 11 | + |
| 12 | +declare(strict_types=1); |
| 13 | + |
| 14 | +namespace League\Uri\Contracts; |
| 15 | + |
| 16 | +use DOMException; |
| 17 | +use JsonSerializable; |
| 18 | + |
| 19 | +interface UriStringProvider extends JsonSerializable |
| 20 | +{ |
| 21 | + /** |
| 22 | + * Returns the string representation as a URI reference. |
| 23 | + * |
| 24 | + * @see http://tools.ietf.org/html/rfc3986#section-4.1 |
| 25 | + */ |
| 26 | + public function toString(): string; |
| 27 | + |
| 28 | + /** |
| 29 | + * Returns the normalized string representation of the URI. |
| 30 | + * |
| 31 | + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-6.2 |
| 32 | + */ |
| 33 | + public function toNormalizedString(): ?string; |
| 34 | + |
| 35 | + /** |
| 36 | + * Returns the human-readable string representation of the URI. |
| 37 | + * |
| 38 | + * @see https://datatracker.ietf.org/doc/html/rfc3986#section-6.2 |
| 39 | + */ |
| 40 | + public function toDisplayString(): ?string; |
| 41 | + |
| 42 | + /** |
| 43 | + * Returns the string representation as a URI reference. |
| 44 | + * |
| 45 | + * @see http://tools.ietf.org/html/rfc3986#section-4.1 |
| 46 | + * @see ::__toString |
| 47 | + */ |
| 48 | + public function jsonSerialize(): string; |
| 49 | + |
| 50 | + /** |
| 51 | + * Returns the HTML string representation of the anchor tag with the current instance as its href attribute. |
| 52 | + * |
| 53 | + * @throws DOMException |
| 54 | + */ |
| 55 | + public function toAnchorTag(?string $content = null, ?string $class = null, ?string $target = null): string; |
| 56 | + |
| 57 | + /** |
| 58 | + * Returns the markdown string representation of the anchor tag with the current instance as its href attribute. |
| 59 | + */ |
| 60 | + public function toMarkdown(?string $content = null): string; |
| 61 | + |
| 62 | + /** |
| 63 | + * Returns the Unix filesystem path. The method returns null for any other scheme. |
| 64 | + */ |
| 65 | + public function toUnixPath(): ?string; |
| 66 | + |
| 67 | + /** |
| 68 | + * Returns the Windows filesystem path. The method returns null for any other scheme. |
| 69 | + */ |
| 70 | + public function toWindowsPath(): ?string; |
| 71 | +} |
0 commit comments