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
DataPathInterface.php
84 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 | /** @internal */ |
| 15 | interface DataPathInterface extends PathInterface |
| 16 | { |
| 17 | /** |
| 18 | * Retrieve the data mime type associated to the URI. |
| 19 | * |
| 20 | * If no mimetype is present, this method MUST return the default mimetype 'text/plain'. |
| 21 | * |
| 22 | * @see http://tools.ietf.org/html/rfc2397#section-2 |
| 23 | */ |
| 24 | public function getMimeType() : string; |
| 25 | /** |
| 26 | * Retrieve the parameters associated with the Mime Type of the URI. |
| 27 | * |
| 28 | * If no parameters is present, this method MUST return the default parameter 'charset=US-ASCII'. |
| 29 | * |
| 30 | * @see http://tools.ietf.org/html/rfc2397#section-2 |
| 31 | */ |
| 32 | public function getParameters() : string; |
| 33 | /** |
| 34 | * Retrieve the mediatype associated with the URI. |
| 35 | * |
| 36 | * If no mediatype is present, this method MUST return the default parameter 'text/plain;charset=US-ASCII'. |
| 37 | * |
| 38 | * @see http://tools.ietf.org/html/rfc2397#section-3 |
| 39 | * |
| 40 | * @return string The URI scheme. |
| 41 | */ |
| 42 | public function getMediaType() : string; |
| 43 | /** |
| 44 | * Retrieves the data string. |
| 45 | * |
| 46 | * Retrieves the data part of the path. If no data part is provided return |
| 47 | * a empty string |
| 48 | */ |
| 49 | public function getData() : string; |
| 50 | /** |
| 51 | * Tells whether the data is binary safe encoded. |
| 52 | */ |
| 53 | public function isBinaryData() : bool; |
| 54 | /** |
| 55 | * Save the data to a specific file. |
| 56 | */ |
| 57 | public function save(string $path, string $mode = 'w') : \SplFileObject; |
| 58 | /** |
| 59 | * Returns an instance where the data part is base64 encoded. |
| 60 | * |
| 61 | * This method MUST retain the state of the current instance, and return |
| 62 | * an instance where the data part is base64 encoded |
| 63 | */ |
| 64 | public function toBinary() : self; |
| 65 | /** |
| 66 | * Returns an instance where the data part is url encoded following RFC3986 rules. |
| 67 | * |
| 68 | * This method MUST retain the state of the current instance, and return |
| 69 | * an instance where the data part is url encoded |
| 70 | */ |
| 71 | public function toAscii() : self; |
| 72 | /** |
| 73 | * Return an instance with the specified mediatype parameters. |
| 74 | * |
| 75 | * This method MUST retain the state of the current instance, and return |
| 76 | * an instance that contains the specified mediatype parameters. |
| 77 | * |
| 78 | * Users must provide encoded characters. |
| 79 | * |
| 80 | * An empty parameters value is equivalent to removing the parameter. |
| 81 | */ |
| 82 | public function withParameters(string $parameters) : self; |
| 83 | } |
| 84 |