configurePart example

$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'));
        }

        return $this->configurePart($name$value);
    }

    private function configurePart(string $name, TextPart $part): TextPart
    {
        static $r;

        $r ??= new \ReflectionProperty(TextPart::class, 'encoding');

        
$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'));
        }

        return $this->configurePart($name$value);
    }

    private function configurePart(string $name, TextPart $part): TextPart
    {
        static $r;

        $r ??= new \ReflectionProperty(TextPart::class, 'encoding');

        
Home | Imprint | This part of the site doesn't use cookies.