Skip to content

Commit

Permalink
chore(composer): Make top-level data classes internal
Browse files Browse the repository at this point in the history
As these classes were just introduced recently in 543de7b, do not mark
the change as breaking. Also make related helper functions internal to
not expose implementation details to the public API.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Aug 7, 2024
1 parent 691c31e commit b9f521e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/package-managers/composer/src/main/kotlin/Model.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ import com.fasterxml.jackson.module.kotlin.readValue
import org.ossreviewtoolkit.model.jsonMapper

@JsonIgnoreProperties(ignoreUnknown = true)
data class Lockfile(
internal data class Lockfile(
val packages: List<PackageInfo> = emptyList(),
@JsonProperty("packages-dev")
val packagesDev: List<PackageInfo> = emptyList()
)

@JsonIgnoreProperties(ignoreUnknown = true)
data class PackageInfo(
internal data class PackageInfo(
val name: String?,
// See https://getcomposer.org/doc/04-schema.md#version.
val version: String?,
Expand Down Expand Up @@ -73,6 +73,6 @@ data class PackageInfo(
)
}

fun parseLockfile(json: String): Lockfile = jsonMapper.readValue<Lockfile>(json)
internal fun parseLockfile(json: String): Lockfile = jsonMapper.readValue<Lockfile>(json)

fun parsePackageInfo(json: String): PackageInfo = jsonMapper.readValue<PackageInfo>(json)
internal fun parsePackageInfo(json: String): PackageInfo = jsonMapper.readValue<PackageInfo>(json)

0 comments on commit b9f521e

Please sign in to comment.