docs/io.github.mkohm.detekt.hint.rules/-open-closed-principle/-init-.md
---
title: OpenClosedPrinciple.<init> -
---
[io.github.mkohm.detekt.hint.rules](../index.html) / [OpenClosedPrinciple](index.html) / [<init>](./-init-.html)
# <init>
`OpenClosedPrinciple(config: Config = Config.empty)`
Open closed principle rule. Only supports catching the easiest cases. Not complex when expressions, with type checking and use of enums.
Supported:
when (enum) {
Color.RED -> ...
Color.Blue -> ...
...
}
when {
a is Square -> ...
b is Circle -> ...
...
}