Skip to content

Commit

Permalink
Deprecate checkModules() API in favor of better verify() API
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudgiuliani committed May 3, 2024
1 parent d9b53e5 commit 3378cbc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import org.koin.test.parameter.MockParameter
/**
* Check all definition's dependencies - start all modules and check if definitions can run
*/
@Deprecated("Migrate to verify() API")
fun KoinApplication.checkModules(parameters: CheckParameters? = null) = koin.checkModules(parameters)

/**
Expand All @@ -49,6 +50,7 @@ fun KoinApplication.checkModules(parameters: CheckParameters? = null) = koin.che
* @param parameters - parameter setup
* @param appDeclaration - koin Application
*/
@Deprecated("Migrate to verify() API")
fun checkModules(level: Level = Level.INFO, parameters: CheckParameters? = null, appDeclaration: KoinAppDeclaration) {
startKoin(appDeclaration)
.logger(KoinPlatformTools.defaultLogger(level))
Expand All @@ -62,6 +64,7 @@ fun checkModules(level: Level = Level.INFO, parameters: CheckParameters? = null,
* @param appDeclaration - Koin app config if needed
* @param parameters - Check parameters DSL
*/
@Deprecated("Migrate to verify() API")
fun checkKoinModules(modules: List<Module>, appDeclaration: KoinAppDeclaration = {}, parameters: CheckParameters? = null) {
startKoin(appDeclaration)
.modules(modules)
Expand Down Expand Up @@ -98,6 +101,7 @@ fun checkKoinModules(vararg modules: Module, level: Level = Level.INFO, paramete
/**
* Check all definition's dependencies - start all modules and check if definitions can run
*/
@Deprecated("Migrate to verify() API")
fun Koin.checkModules(parametersDefinition: CheckParameters? = null) {
logger.info("[Check] checking modules ...")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ import kotlin.reflect.KClass

//TODO TO BE DEPRECATED in 3.6

@Deprecated("Migrate to verify() API")
data class CheckedComponent(val qualifier: Qualifier? = null, val type: KClass<*>)

@Deprecated("Migrate to verify() API")
class ParametersBinding(val koin: Koin) {

val parametersCreators = mutableMapOf<CheckedComponent, ParametersCreator>()
Expand Down

0 comments on commit 3378cbc

Please sign in to comment.