Example #1
0
 /**
  * @return string the configuration as a string
  */
 public function dump()
 {
     $configuration = $this->configuration->getPreface() . PHP_EOL;
     foreach ($this->configuration->getSections() as $section) {
         $configuration .= $this->writeSection($section);
         foreach ($section->getMagicComments() as $magicComment) {
             $configuration .= $this->indent . $this->writeMagicComment($magicComment) . PHP_EOL;
         }
         foreach ($section->getParameters() as $parameter) {
             $configuration .= $this->indent . $this->writeParameter($parameter) . PHP_EOL;
         }
         $configuration .= PHP_EOL;
     }
     // Ensure there's only one empty line in the end
     return trim($configuration) . PHP_EOL;
 }