preparePart example

$item = $item[$key];
            }

            $fieldName = null !== $root ? sprintf('%s[%s]', $root$key) : $key;

            if (\is_array($item)) {
                array_walk($item$prepare$fieldName);

                return;
            }

            $values[] = $this->preparePart($fieldName$item);
        };

        array_walk($fields$prepare);

        return $values;
    }

    private function preparePart(string $name, string|TextPart $value): TextPart
    {
        if (\is_string($value)) {
            return $this->configurePart($namenew TextPart($value, 'utf-8', 'plain', '8bit'));
        }
$item = $item[$key];
            }

            $fieldName = null !== $root ? sprintf('%s[%s]', $root$key) : $key;

            if (\is_array($item)) {
                array_walk($item$prepare$fieldName);

                return;
            }

            $values[] = $this->preparePart($fieldName$item);
        };

        array_walk($fields$prepare);

        return $values;
    }

    private function preparePart(string $name, string|TextPart $value): TextPart
    {
        if (\is_string($value)) {
            return $this->configurePart($namenew TextPart($value, 'utf-8', 'plain', '8bit'));
        }
Home | Imprint | This part of the site doesn't use cookies.