/**
  * Handles sync task complete event.
  *
  * @param SyncTaskCompleteEvent $event
  */
 public function handleEvent($event)
 {
     switch ($event->getTaskType()) {
         case SyncTaskCompleteEvent::TASK_TYPE_DOWNLOAD:
             $task = new SyncTask(SyncTask::SYNC_TASK_PRESERVEHOST);
             $task->setName(SyncTaskCompleteEvent::TASK_TYPE_CONVERT);
             $task->setArguments([$event->getProvider(), $event->getOutputFile()]);
             if ($event->getDataDescription()) {
                 $task->setArguments(array_merge($task->getArguments(), ['-t', $event->getDataDescription()]));
             }
             $this->publisher->publish($task);
             break;
         case SyncTaskCompleteEvent::TASK_TYPE_CONVERT:
             $task = new SyncTask(SyncTask::SYNC_TASK_PRESERVEHOST);
             $task->setName(SyncTaskCompleteEvent::TASK_TYPE_PUSH);
             $task->setArguments([$event->getOutputFile(), '-p', $event->getProvider()]);
             switch ($event->getDataType()) {
                 case SyncTaskCompleteEvent::DATA_TYPE_PARTIAL_DOCUMENTS:
                     $task->setArguments(array_merge($task->getArguments(), ['-d']));
                     break;
                 default:
                     // No other cases.
                     break;
             }
             $this->publisher->publish($task);
             break;
         default:
             // No other cases.
             break;
     }
 }