original_string: protected static function addJobByOperationType(
          OperationInterface $operation,
          \Closure $install,
          \Closure $uninstall,
          \Closure $update = null
      ) {
          switch ($operation->getJobType()) {
              case 'install':
                  self::getContainer()->addJob($install($operation->getPackage()));
                  break;
              case 'uninstall':
                  self::getContainer()->addJob($uninstall($operation->getPackage()));
                  break;
              case 'update':
                  $update = $update ?: $install;
                  self::getContainer()->addJob($update($operation->getTargetPackage()));
                  break;
          }
      }
code: protected static function addJobByOperationType(
          OperationInterface $operation,
          \Closure $install,
          \Closure $uninstall,
          \Closure $update = null
      ) {
          switch ($operation->getJobType()) {
              case 'install':
                  self::getContainer()->addJob($install($operation->getPackage()));
                  break;
              case 'uninstall':
                  self::getContainer()->addJob($uninstall($operation->getPackage()));
                  break;
              case 'update':
                  $update = $update ?: $install;
                  self::getContainer()->addJob($update($operation->getTargetPackage()));
                  break;
          }
      }
code_tokens: protected static function addJobByOperationType ( OperationInterface $ operation , \ Closure $ install , \ Closure $ uninstall , \ Closure $ update = null ) { switch ( $ operation -> getJobType ( ) ) { case 'install' : self :: getContainer ( ) -> addJob ( $ install ( $ operation -> getPackage ( ) ) ) ; break ; case 'uninstall' : self :: getContainer ( ) -> addJob ( $ uninstall ( $ operation -> getPackage ( ) ) ) ; break ; case 'update' : $ update = $ update ? : $ install ; self :: getContainer ( ) -> addJob ( $ update ( $ operation -> getTargetPackage ( ) ) ) ; break ; } }
docstring: Add job by operation type.
  
  @param OperationInterface $operation
  @param \Closure $install
  @param \Closure $update
  @param \Closure $uninstall
docstring_tokens: Add job by operation type .