settings = $settings; $this->identity = $identity; } public function __toString() { return '|> reduce(fn: (r, accumulator) => ({' . implode(', ', $this->formatSettings($this->settings)) . '}), ' . 'identity: {' . Formatters::toFluxAssociativeArrayString($this->identity) . '}) '; } protected function formatSettings(array $settings) { array_walk($settings, function(&$value, $key) { $value = $key . ': ' . $value; }); return $settings; } }