Skip to content

Commit 7eacdf7

Browse files
Remove internal annotation
1 parent 2dcf313 commit 7eacdf7

File tree

3 files changed

+40
-6
lines changed

3 files changed

+40
-6
lines changed

UPGRADE-5.3.md

Lines 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

Lines 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

Lines 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)