66
77/**
88 * Interface for Type objects.
9- *
10- * @api
119 */
1210interface TypeInterface
1311{
@@ -20,71 +18,95 @@ interface TypeInterface
2018 * MIME type string to be parsed.
2119 * @param class-string<MimeMapInterface>|null $mapClass
2220 * (Optional) The FQCN of the map class to use.
21+ *
22+ * @api
2323 */
2424 public function __construct (string $ typeString , ?string $ mapClass = null );
2525
2626 /**
2727 * Gets a MIME type's media.
2828 *
2929 * Note: 'media' refers to the portion before the first slash.
30+ *
31+ * @api
3032 */
3133 public function getMedia (): string ;
3234
3335 /**
3436 * Sets a MIME type's media.
37+ *
38+ * @api
3539 */
3640 public function setMedia (string $ media ): TypeInterface ;
3741
3842 /**
3943 * Checks if the MIME type has media comment.
44+ *
45+ * @api
4046 */
4147 public function hasMediaComment (): bool ;
4248
4349 /**
4450 * Gets the MIME type's media comment.
4551 *
4652 * @throws UndefinedException
53+ *
54+ * @api
4755 */
4856 public function getMediaComment (): string ;
4957
5058 /**
5159 * Sets the MIME type's media comment.
5260 *
5361 * @param string $comment (optional) a comment; when missing any existing comment is removed.
62+ *
63+ * @api
5464 */
5565 public function setMediaComment (?string $ comment = null ): TypeInterface ;
5666
5767 /**
5868 * Gets a MIME type's subtype.
69+ *
70+ * @api
5971 */
6072 public function getSubType (): string ;
6173
6274 /**
6375 * Sets a MIME type's subtype.
76+ *
77+ * @api
6478 */
6579 public function setSubType (string $ subType ): TypeInterface ;
6680
6781 /**
6882 * Checks if the MIME type has subtype comment.
83+ *
84+ * @api
6985 */
7086 public function hasSubTypeComment (): bool ;
7187
7288 /**
7389 * Gets the MIME type's subtype comment.
7490 *
7591 * @throws UndefinedException
92+ *
93+ * @api
7694 */
7795 public function getSubTypeComment (): string ;
7896
7997 /**
8098 * Sets the MIME type's subtype comment.
8199 *
82100 * @param string|null $comment (optional) a comment; when missing any existing comment is removed.
101+ *
102+ * @api
83103 */
84104 public function setSubTypeComment (?string $ comment = null ): TypeInterface ;
85105
86106 /**
87107 * Checks if the MIME type has any parameter.
108+ *
109+ * @api
88110 */
89111 public function hasParameters (): bool ;
90112
@@ -94,30 +116,40 @@ public function hasParameters(): bool;
94116 * @return TypeParameter[]
95117 *
96118 * @throws UndefinedException
119+ *
120+ * @api
97121 */
98122 public function getParameters (): array ;
99123
100124 /**
101125 * Checks if the MIME type has a parameter.
102126 *
103127 * @throws UndefinedException
128+ *
129+ * @api
104130 */
105131 public function hasParameter (string $ name ): bool ;
106132
107133 /**
108134 * Get a MIME type's parameter.
109135 *
110136 * @throws UndefinedException
137+ *
138+ * @api
111139 */
112140 public function getParameter (string $ name ): TypeParameter ;
113141
114142 /**
115143 * Add a parameter to this type
144+ *
145+ * @api
116146 */
117147 public function addParameter (string $ name , string $ value , ?string $ comment = null ): void ;
118148
119149 /**
120150 * Remove a parameter from this type.
151+ *
152+ * @api
121153 */
122154 public function removeParameter (string $ name ): void ;
123155
@@ -128,6 +160,8 @@ public function removeParameter(string $name): void;
128160 *
129161 * @param int $format
130162 * The format of the output string.
163+ *
164+ * @api
131165 */
132166 public function toString (int $ format = Type::FULL_TEXT ): string ;
133167
@@ -136,23 +170,31 @@ public function toString(int $format = Type::FULL_TEXT): string;
136170 *
137171 * Note: Experimental types are denoted by a leading 'x-' in the media or
138172 * subtype, e.g. text/x-vcard or x-world/x-vrml.
173+ *
174+ * @api
139175 */
140176 public function isExperimental (): bool ;
141177
142178 /**
143179 * Is this a vendor MIME type?
144180 *
145181 * Note: Vendor types are denoted with a leading 'vnd. in the subtype.
182+ *
183+ * @api
146184 */
147185 public function isVendor (): bool ;
148186
149187 /**
150188 * Is this a wildcard type?
189+ *
190+ * @api
151191 */
152192 public function isWildcard (): bool ;
153193
154194 /**
155195 * Is this an alias?
196+ *
197+ * @api
156198 */
157199 public function isAlias (): bool ;
158200
@@ -168,6 +210,8 @@ public function isAlias(): bool;
168210 *
169211 * @return bool
170212 * True if there was a match, false otherwise.
213+ *
214+ * @api
171215 */
172216 public function wildcardMatch (string $ wildcard ): bool ;
173217
@@ -180,11 +224,15 @@ public function wildcardMatch(string $wildcard): bool;
180224 * @throws MappingException if no mapping found.
181225 *
182226 * @return array<int,int|string>
227+ *
228+ * @api
183229 */
184230 public function buildTypesList (): array ;
185231
186232 /**
187233 * Checks if a description for the MIME type exists.
234+ *
235+ * @api
188236 */
189237 public function hasDescription (): bool ;
190238
@@ -197,6 +245,8 @@ public function hasDescription(): bool;
197245 * appended with a comma. Defaults to false.
198246 *
199247 * @throws MappingException if no description found.
248+ *
249+ * @api
200250 */
201251 public function getDescription (bool $ includeAcronym = false ): string ;
202252
@@ -209,13 +259,17 @@ public function getDescription(bool $includeAcronym = false): string;
209259 * @throws MappingException on error.
210260 *
211261 * @return list<string>
262+ *
263+ * @api
212264 */
213265 public function getAliases (): array ;
214266
215267 /**
216268 * Returns the MIME type's preferred file extension.
217269 *
218270 * @throws MappingException if no mapping found.
271+ *
272+ * @api
219273 */
220274 public function getDefaultExtension (): string ;
221275
@@ -227,6 +281,8 @@ public function getDefaultExtension(): string;
227281 * @throws MappingException if no mapping found.
228282 *
229283 * @return list<string>
284+ *
285+ * @api
230286 */
231287 public function getExtensions (): array ;
232288}
0 commit comments