/** * @return void */ protected function write() { /* Convert to INI format */ $fileContents = ''; foreach ($this->contents as $section => $contents) { if (count($contents) > 0) { $fileContents .= "[{$section}]" . PHP_EOL; foreach ($contents as $name => $value) { $fileContents .= "{$name} = {$value}" . PHP_EOL; } } } $this->fileCookies->putContents($fileContents); }
/** * @return void */ public function write() { $encodedData = json_encode($this->data, JSON_PRETTY_PRINT); $this->source->putContents($encodedData); }