Skip to content

Navigation Menu

Sign in
Appearance settings

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 7eacdf7

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

File tree

3 files changed

+40
-6
lines changed
Filter options

3 files changed

+40
-6
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 the internal annotation from the method `getHeaderBody()` and `getHeaderParameter()` of the `Headers` class.
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
-6Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,6 @@ 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;
@@ -274,9 +271,6 @@ public function setHeaderBody(string $type, string $name, $body): void
274271
}
275272
}
276273

277-
/**
278-
* @internal
279-
*/
280274
public function getHeaderParameter(string $name, string $parameter): ?string
281275
{
282276
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.