every = $every; $this->fn = $fn; $this->options = $options; } public function __toString() { $input = new ArrayType(array_filter([ 'every' => new DurationType($this->every), 'period' => isset($this->options['period']) ? new DurationType($this->options['period']) : null, 'offset' => isset($this->options['offset']) ? new DurationType($this->options['offset']) : null, 'fn' => new CustomType($this->fn), 'location' => isset($this->options['location']) ? new Type($this->options['location']) : null, 'column' => isset($this->options['column']) ? new Type($this->options['column']) : null, 'timeSrc' => isset($this->options['timeSrc']) ? new Type($this->options['timeSrc']) : null, 'timeDst' => isset($this->options['timeDst']) ? new Type($this->options['timeDst']) : null, 'createEmpty' => isset($this->options['createEmpty']) && !$this->options['createEmpty'] ? new Type($this->options['createEmpty']) : null, ])); return '|> aggregateWindow(' . $input . ') '; } }