/** * @param AbstractSection $section * * @return string */ private function writeSection(AbstractSection $section) { $output = $section->getType(); if ($section instanceof NamedSection) { $output .= ' ' . $section->getName(); } $output .= PHP_EOL; return $output; }
/** * @param AbstractSection $section * @param string $line */ private function parseSectionLine($section, $line) { // Distinguish between parameters and magic comments if ($this->isMagicComment($line)) { $section->addMagicComment($this->parseMagicComment($line)); } else { if (!$this->isComment($line)) { $section->addParameter($this->parseParameter($line)); } } }