[Mime] removed the 2 parts constraints on Multipart (not true for DataFormPart for instance)

This commit is contained in:
Fabien Potencier 2019-03-07 23:32:55 +01:00
parent 0450c4f244
commit 5c8a4e3deb
1 changed files with 0 additions and 11 deletions

View File

@ -11,7 +11,6 @@
namespace Symfony\Component\Mime\Part;
use Symfony\Component\Mime\Exception\LogicException;
use Symfony\Component\Mime\Header\Headers;
/**
@ -57,11 +56,6 @@ abstract class AbstractMultipartPart extends AbstractPart
public function bodyToString(): string
{
$parts = $this->getParts();
if (\count($parts) < 2) {
throw new LogicException(sprintf('A "%s" instance must have at least 2 parts.', __CLASS__));
}
$string = '';
foreach ($parts as $part) {
$string .= '--'.$this->getBoundary()."\r\n".$part->toString()."\r\n";
@ -74,11 +68,6 @@ abstract class AbstractMultipartPart extends AbstractPart
public function bodyToIterable(): iterable
{
$parts = $this->getParts();
if (\count($parts) < 2) {
throw new LogicException(sprintf('A "%s" instance must have at least 2 parts.', __CLASS__));
}
foreach ($parts as $part) {
yield '--'.$this->getBoundary()."\r\n";
foreach ($part->toIterable() as $chunk) {