-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathDataUriInterface.php
More file actions
93 lines (76 loc) Β· 2.2 KB
/
DataUriInterface.php
File metadata and controls
93 lines (76 loc) Β· 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
declare(strict_types=1);
namespace Intervention\Image\Interfaces;
use Intervention\Image\MediaType;
use Stringable;
interface DataUriInterface extends Stringable
{
/**
* Parse new object from given data uri scheme string.
*/
public static function parse(string $dataUriScheme): self;
/**
* Create data uri object from given unencoded data.
*
* @param array<string, string> $parameters
*/
public static function create(
string $data,
null|string|MediaType $mediaType = null,
array $parameters = [],
): self;
/**
* Return current data uri data.
*/
public function data(): string;
/**
* Set data of current data uri scheme.
*/
public function setData(string $data): self;
/**
* Get media type of current data uri output.
*/
public function mediaType(): ?string;
/**
* Set media type of current data uri output.
*/
public function setMediaType(null|string|MediaType $mediaType): self;
/**
* Get all parameters of current data uri output.
*
* @return array<string, string>
*/
public function parameters(): array;
/**
* Set (overwrite) all parameters of current data uri output.
*
* @param array<string, string> $parameters
*/
public function setParameters(array $parameters): self;
/**
* Append given parameters to current data uri output.
*
* @param array<string, string> $parameters
*/
public function appendParameters(array $parameters): self;
/**
* Get value of given parameter, return null if parameter is not set.
*/
public function parameter(string $key): ?string;
/**
* Set (overwrite) parameter of given key to given value.
*/
public function setParameter(string $key, string $value): self;
/**
* Get charset of current data uri scheme, null if no charset is defined.
*/
public function charset(): ?string;
/**
* Define charset of current data uri scheme.
*/
public function setCharset(string $charset): self;
/**
* Transform current data uri scheme to string.
*/
public function toString(): string;
}