Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7f2b7a3

Browse filesBrowse files
Remove internal annotation
1 parent 2dcf313 commit 7f2b7a3
Copy full SHA for 7f2b7a3

File tree

3 files changed

+40
-12
lines changed
Filter options

3 files changed

+40
-12
lines changed

‎UPGRADE-5.3.md

Copy file name to clipboardExpand all lines: UPGRADE-5.3.md
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ Messenger
6060
* Deprecated the `prefetch_count` parameter in the AMQP bridge, it has no effect and will be removed in Symfony 6.0
6161
* Deprecated the use of TLS option for Redis Bridge, use `rediss://127.0.0.1` instead of `redis://127.0.0.1?tls=1`
6262

63+
Mime
64+
----
65+
66+
* Remove internal annotation to the method `getHeaderBody`, `setHeaderBody`, `getHeaderParameter` and `setHeaderParameter`
67+
6368
Notifier
6469
--------
6570

‎src/Symfony/Component/Mime/Header/Headers.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mime/Header/Headers.php
-12Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -254,17 +254,11 @@ public function toArray(): array
254254
return $arr;
255255
}
256256

257-
/**
258-
* @internal
259-
*/
260257
public function getHeaderBody($name)
261258
{
262259
return $this->has($name) ? $this->get($name)->getBody() : null;
263260
}
264261

265-
/**
266-
* @internal
267-
*/
268262
public function setHeaderBody(string $type, string $name, $body): void
269263
{
270264
if ($this->has($name)) {
@@ -274,9 +268,6 @@ public function setHeaderBody(string $type, string $name, $body): void
274268
}
275269
}
276270

277-
/**
278-
* @internal
279-
*/
280271
public function getHeaderParameter(string $name, string $parameter): ?string
281272
{
282273
if (!$this->has($name)) {
@@ -291,9 +282,6 @@ public function getHeaderParameter(string $name, string $parameter): ?string
291282
return $header->getParameter($parameter);
292283
}
293284

294-
/**
295-
* @internal
296-
*/
297285
public function setHeaderParameter(string $name, string $parameter, $value): void
298286
{
299287
if (!$this->has($name)) {

‎src/Symfony/Component/Mime/Tests/Header/HeadersTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mime/Tests/Header/HeadersTest.php
+35Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,4 +279,39 @@ public function testToArray()
279279
"Foo: =?utf-8?Q?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa?=\r\n =?utf-8?Q?aaaa?=",
280280
], $headers->toArray());
281281
}
282+
283+
public function testHeaderBody()
284+
{
285+
$headers = new Headers();
286+
$this->assertNull($headers->getHeaderBody('Content-Type'));
287+
$headers->setHeaderBody('Text', 'Content-Type', 'type');
288+
$this->assertSame('type', $headers->getHeaderBody('Content-Type'));
289+
}
290+
291+
public function testHeaderParameter()
292+
{
293+
$headers = new Headers();
294+
$this->assertNull($headers->getHeaderParameter('Content-Disposition', 'name'));
295+
296+
$headers->addParameterizedHeader('Content-Disposition', 'name');
297+
$headers->setHeaderParameter('Content-Disposition', 'name', 'foo');
298+
$this->assertSame('foo', $headers->getHeaderParameter('Content-Disposition', 'name'));
299+
}
300+
301+
public function testHeaderParameterNotDefined()
302+
{
303+
$headers = new Headers();
304+
305+
$this->expectException(\LogicException::class);
306+
$headers->setHeaderParameter('Content-Disposition', 'name', 'foo');
307+
}
308+
309+
public function testSetHeaderParameterNotParameterized()
310+
{
311+
$headers = new Headers();
312+
$headers->addTextHeader('Content-Disposition', 'name');
313+
314+
$this->expectException(\LogicException::class);
315+
$headers->setHeaderParameter('Content-Disposition', 'name', 'foo');
316+
}
282317
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.