stream = $stream; $return = $this->run(); unset( $this->stream ); return $return; } /** * Return the stream. * * @return \ContentControl\Services\UpgradeStream|Object $stream Stream. */ public function stream() { $noop = function () {}; return isset( $this->stream ) ? $this->stream : (object) [ 'send_event' => $noop, 'send_error' => $noop, 'send_data' => $noop, 'update_status' => $noop, 'update_task_status' => $noop, 'start_upgrades' => $noop, 'complete_upgrades' => $noop, 'start_task' => $noop, 'update_task_progress' => $noop, 'complete_task' => $noop, ]; } }