Skip to content
Novus Examples
lock5.9 KB

composer.lock (PHP)

A PHP composer.lock in JSON, pinning each fictional package by both a git reference and a dist zip shasum, with a content-hash binding it to composer.json. Every package, version, hash and licence is fictional — the tree describes nothing real.

Preview — first 50 lineslock
{
  "_readme": [
    "This file locks the dependencies of your project to a known state",
    "SAMPLE — fictional supply-chain data. Every package, registry, version, hash, licence, advisory identifier and signature in this document is invented."
  ],
  "content-hash": "45c7b97a9c513a108918827c56dd9c9e11851d914fb15e537b9d2d5cdf3c79fb",
  "packages": [
    {
      "name": "orchard-example/router",
      "version": "v2.1.3",
      "source": {
        "type": "git",
        "url": "https://git.orchard.example/router.git",
        "reference": "f7b5829b736e1638ac6bc5d460b2a398b6d0aefa"
      },
      "dist": {
        "type": "zip",
        "url": "https://dist.orchard.example/router-2.1.3.zip",
        "shasum": "241a1955817049501c38150e9b4d89dace5ba375"
      },
      "require": {
        "orchard-example/logger": "^3.4.1",
        "orchard-example/retry": "^1.0.4"
      },
      "type": "library",
      "license": [
        "Apache-2.0"
      ],
      "time": "2026-01-01T00:00:00+00:00"
    },
    {
      "name": "orchard-example/http-core",
      "version": "v1.8.0",
      "source": {
        "type": "git",
        "url": "https://git.orchard.example/http-core.git",
        "reference": "ca5ca5889150e78456a2c2677032bdfc8d734ec2"
      },
      "dist": {
        "type": "zip",
        "url": "https://dist.orchard.example/http-core-1.8.0.zip",
        "shasum": "9dbd1b1fa8eafff88f0fb694f9e755eda0e65e81"
      },
      "require": {
        "orchard-example/logger": "^3.4.1",
        "orchard-example/jsonpath": "^2.0.5"
      },
      "type": "library",
      "license": [
        "MIT"
217 lines total — download for the full file.

Specifications

Seed
51200
Sample Only
true
Ecosystem
Composer
Packages
9
Dev Packages
0
Sources
git reference + zip shasum
Line Endings
LF

Testing contract

Expected to pass
Scenario
Extract both source and dist pins from a composer.lock.
Expected result
Nine packages each yield a 40-character git reference and a dist shasum, and packages-dev is read as an empty list rather than as missing.

What is a .lock file?

A .lock file pins the exact dependency graph a package manager resolved, so a later install reproduces it byte for byte. Cargo.lock and Poetry's poetry.lock use TOML, Gemfile.lock and yarn.lock use their own line-oriented grammars, and all of them record resolved versions, source registries, integrity hashes, and the transitive edges between packages. It is committed alongside the human-edited manifest, which states ranges rather than exact versions.

How to use this file

Use an example .lock file to test dependency parsers, SBOM generators, and vulnerability scanners, verifying that transitive dependencies and integrity hashes are read correctly and that a pinned version is never confused with the range declared in the manifest.

How to use this file for testing

“composer.lock (PHP)” is a deterministic Novus Examples fixture for JSON parsing, Config parsing, Conversion testing. Flat, deeply nested, JSON Lines, and intentionally invalid JSON for testing parsers and error handling.

Documented properties for this file: seed 51200 · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

SBOM, lockfile, provenance, and advisory fixtures describe the same fabricated component tree across formats, so a converter or scanner can be diffed against a known answer. Every package name, version, hash, and advisory ID is invented — never treat a finding here as real.

Feed the file to your parser and assert it handles the documented quirks — quoted delimiters, embedded newlines, ragged rows, or invalid syntax; the valid↔invalid distinction is labelled in the title.

Generated by generation/supply_chain.py. Free for any use, no attribution required — license.