PHPackages                             zero-to-prod/composer-package - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. zero-to-prod/composer-package

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zero-to-prod/composer-package
=============================

A DataModel representing a `composer.json` file

v1.1.0(1y ago)29[1 PRs](https://github.com/zero-to-prod/composer-package/pulls)MITPHPPHP &gt;=8.1CI passing

Since Jan 14Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/zero-to-prod/composer-package)[ Packagist](https://packagist.org/packages/zero-to-prod/composer-package)[ Docs](https://github.com/zero-to-prod/composer-package)[ Fund](https://github.com/sponsors/zero-to-prod)[ RSS](/packages/zero-to-prod-composer-package/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (4)Versions (9)Used By (0)

Zerotoprod\\ComposerPackage
===========================

[](#zerotoprodcomposerpackage)

[![](art/logo.png)](art/logo.png)

[![Repo](https://camo.githubusercontent.com/9a90a3efeee26aed7d7f2feee9cd84566a26f9c362cc773b184d076210906e1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6769746875622d677261793f6c6f676f3d676974687562)](https://github.com/zero-to-prod/composer-package)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/b5efa27e9d3d37fcb8ce4e3a3ed947baf835f889776ad52132a6e73c615a9491/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f636f6d706f7365722d7061636b6167652f746573742e796d6c3f6c6162656c3d74657374)](https://github.com/zero-to-prod/composer-package/actions)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/8473acdc353003decf3020cf3d060e1b31ec7e78d3de49b277ee15f3051ea1bf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f636f6d706f7365722d7061636b6167652f6261636b77617264735f636f6d7061746962696c6974792e796d6c3f6c6162656c3d6261636b77617264735f636f6d7061746962696c697479)](https://github.com/zero-to-prod/composer-package/actions)[![Packagist Downloads](https://camo.githubusercontent.com/37658a15fe740c8db66519e5120cc0b6deefbab1a659b013752952efdfaadc48/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a65726f2d746f2d70726f642f636f6d706f7365722d7061636b6167653f636f6c6f723d626c7565)](https://packagist.org/packages/zero-to-prod/composer-package/stats)[![php](https://camo.githubusercontent.com/d4f7f141af29ad13742eb3bb5aacbf8f8c3ba46ece273883d5356dc339c773ae/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7a65726f2d746f2d70726f642f636f6d706f7365722d7061636b6167652e7376673f636f6c6f723d707572706c65)](https://packagist.org/packages/zero-to-prod/composer-package/stats)[![Packagist Version](https://camo.githubusercontent.com/5aa386f1a087ef436ec4e858b544d0b19e5a4bce21234e87bf5c5f5b2c89d408/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a65726f2d746f2d70726f642f636f6d706f7365722d7061636b6167653f636f6c6f723d663238643161)](https://packagist.org/packages/zero-to-prod/composer-package)[![License](https://camo.githubusercontent.com/c3d697a3fa2c5ca43d758426da30bb5bfe76793519abdd0282030b8d610b3285/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7a65726f2d746f2d70726f642f636f6d706f7365722d7061636b6167653f636f6c6f723d70696e6b)](https://github.com/zero-to-prod/composer-package/blob/main/LICENSE.md)[![wakatime](https://camo.githubusercontent.com/32794da88b49e2404fc1f7ab0db9318278976b80d814813ce2909dafd6b4ea70/68747470733a2f2f77616b6174696d652e636f6d2f62616467652f6769746875622f7a65726f2d746f2d70726f642f636f6d706f7365722d7061636b6167652e737667)](https://wakatime.com/badge/github/zero-to-prod/composer-package)[![Hits-of-Code](https://camo.githubusercontent.com/3b7b890d40da8d52a3e4314e0018f3285f5c34c1934fb71fb01112e785955386/68747470733a2f2f686974736f66636f64652e636f6d2f6769746875622f7a65726f2d746f2d70726f642f636f6d706f7365722d7061636b6167653f6272616e63683d6d61696e)](https://hitsofcode.com/github/zero-to-prod/composer-package/view?branch=main)

Contents
--------

[](#contents)

- [Introduction](#introduction)
- [Requirements](#requirements)
- [Installation](#installation)
- [Documentation Publishing](#documentation-publishing)
    - [Automatic Documentation Publishing](#automatic-documentation-publishing)
- [Usage](#usage)
- [Local Development](./LOCAL_DEVELOPMENT.md)
- [Contributing](#contributing)

Introduction
------------

[](#introduction)

Creates a [DataModel](https://github.com/zero-to-prod/data-model) representation of a `composer.json` file.

Requirements
------------

[](#requirements)

- PHP 8.1 or higher.

Installation
------------

[](#installation)

Install `Zerotoprod\ComposerPackage` via [Composer](https://getcomposer.org/):

```
composer require zero-to-prod/composer-package
```

This will add the package to your project's dependencies and create an autoloader entry for it.

Documentation Publishing
------------------------

[](#documentation-publishing)

You can publish this README to your local documentation directory.

This can be useful for providing documentation for AI agents.

This can be done using the included script:

```
# Publish to default location (./docs/zero-to-prod/composer-package)
vendor/bin/zero-to-prod-composer-package

# Publish to custom directory
vendor/bin/zero-to-prod-composer-package /path/to/your/docs
```

### Automatic Documentation Publishing

[](#automatic-documentation-publishing)

You can automatically publish documentation by adding the following to your `composer.json`:

```
{
    "scripts": {
        "post-install-cmd": [
            "zero-to-prod-composer-package"
        ],
        "post-update-cmd": [
            "zero-to-prod-composer-package"
        ]
    }
}
```

Usage
-----

[](#usage)

Create a [DataModel](https://github.com/zero-to-prod/data-model) from a `composer.json` file like this:

```
use Zerotoprod\ComposerPackage\ComposerPackage;

$ComposerPackage = ComposerPackage::from(json_decode(file_get_contents(__DIR__ . 'composer.json'), true));
```

Contributing
------------

[](#contributing)

Contributions, issues, and feature requests are welcome! Feel free to check the [issues](https://github.com/zero-to-prod/composer-package/issues) page if you want to contribute.

1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Commit changes (`git commit -m 'Add some feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Create a new Pull Request.

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance55

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

6

Last Release

480d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/502649f05d36c87d494988bd99193a4d908d345335d99c080928a726277371f5?d=identicon)[zero-to-prod](/maintainers/zero-to-prod)

---

Top Contributors

[![zero-to-prod](https://avatars.githubusercontent.com/u/61474950?v=4)](https://github.com/zero-to-prod "zero-to-prod (18 commits)")

---

Tags

composer-packageDataModeldata modelzero-to-prod

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zero-to-prod-composer-package/health.svg)

```
[![Health](https://phpackages.com/badges/zero-to-prod-composer-package/health.svg)](https://phpackages.com/packages/zero-to-prod-composer-package)
```

###  Alternatives

[zero-to-prod/data-model

Transforms Data into Type-Safe DTOs.

14226.2k32](/packages/zero-to-prod-data-model)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
