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