/**
  * Creates a job from given config file in yaml format
  *
  * @param string $filepath
  * @param null|string $host
  * @param null|string $port
  * @return RestoreJob
  * @throws \Exception
  * @author Daniel Wendlandt
  */
 public function createJobFromConfig($filepath, $host = null, $port = null)
 {
     $config = $this->filesystem->loadYamlConfig($filepath);
     if (null === $host) {
         $host = $config['host'];
     }
     if (null === $port) {
         $port = $config['port'];
     }
     $source = $config['source'] . DIRECTORY_SEPARATOR . $config['name'];
     $job = $this->createJob($source, $host, $port);
     $strategy = new RestoreStrategy();
     $strategy->setStrategy($config['strategy']['strategy']);
     foreach ($config['strategy']['mappings'] as $actionConfig) {
         $mappingAction = RestoreStrategy\MappingAction::createFromArray($actionConfig);
         $strategy->addMappingAction($mappingAction);
     }
     $job->setStrategy($strategy);
     return $job;
 }