protected function connectHooks($taskId, $jobObject)
    {

        if ($jobObject instanceof Chatty) {
            $jobObject->onMessage(function ($message, $level=Chatty::INFO) use ($taskId) {
                $this->writeMessage($taskId, $message, $level);
            });
        }

        if ($jobObject instanceof PublishesProgress) {
            $jobObject->onProgressChanged(function (Progress $progress) use ($taskId) {
                $this->writeProgress($taskId, $progress);
            });
        }
    }
protected function connectHooks($taskId, $jobObject)
    {

        if ($jobObject instanceof Chatty) {
            $jobObject->onMessage(function ($message, $level=Chatty::INFO) use ($taskId) {
                $this->writeMessage($taskId, $message, $level);
            });
        }

        if ($jobObject instanceof PublishesProgress) {
            $jobObject->onProgressChanged(function (Progress $progress) use ($taskId) {
                $this->writeProgress($taskId, $progress);
            });
        }
    }
protected function connectHooks ( $ taskId , $ jobObject ) { if ( $ jobObject instanceof Chatty ) { $ jobObject -> onMessage ( function ( $ message , $ level = Chatty :: INFO ) use ( $ taskId ) { $ this -> writeMessage ( $ taskId , $ message , $ level ) ; } ) ; } if ( $ jobObject instanceof PublishesProgress ) { $ jobObject -> onProgressChanged ( function ( Progress $ progress ) use ( $ taskId ) { $ this -> writeProgress ( $ taskId , $ progress ) ; } ) ; } }
Log messages and progress if this is emitted by the operation.

@param int|string    $taskId
@param object        $jobObject
Log messages and progress if this is emitted by the operation .