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;
        }
    }