delimiter = $delimiter; } /** * processConfig(): defined by AbstractWriter. * * @param array $config * @return string * @throws Exception\UnprocessableConfigException For non-scalar values in the $config array. */ public function processConfig(array $config) { $string = ''; foreach ($config as $key => $value) { if (! is_scalar($value)) { throw new Exception\UnprocessableConfigException(sprintf( '%s configuration writer can only process scalar values; received "%s" for key "%s"', self::class, is_object($value) ? $value::class : gettype($value), $key )); } $value = $value ?? ''; $string .= sprintf( "%s%s%s\n", $key, $this->delimiter, $value ); } return $string; } }