public function evaluate() { $collection = $this->tsValue('collection'); $key = $this->tsValue('key'); $item = $this->tsValue('item'); if ($key) { $collection[$key] = $item; } else { $collection[] = $item; } return $collection; }