16 $this->content = $content;
24 $lines = array_merge($lines, $this->chipLine($line));
27 return implode(
"\r\n", $lines).
"\r\n";
32 $lines[] =
"BEGIN:{$this->content->getType()}";
36 $this->buildProperties(),
37 $this->buildSubComponents()
40 $lines[] =
"END:{$this->content->getType()}";
45 private function buildProperties(): array
49 foreach ($this->content->getProperties() as $key => $property)
62 private function buildSubComponents(): array
66 foreach ($this->content->getSubComponents() as $component) {
67 $builder =
new ComponentCreator($component->accessContent());
71 $builder->buildComponent()
78 private function chipLine(
string $line): array
82 while (strlen($line) > 0)
84 if (strlen($line) > 75)
86 $chippedLines[] = mb_strcut($line, 0, 75,
'utf-8');
87 $line =
' '.mb_strcut($line, 75, strlen($line),
'utf-8');
91 $chippedLines[] = $line;