PHPackages                             phramz/composer-repository-model - 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. phramz/composer-repository-model

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

phramz/composer-repository-model
================================

composer repository (aka `packages.json`) model builder component

6150PHP

Since Mar 18Pushed 11y ago2 watchersCompare

[ Source](https://github.com/phramz/php-composer-repository-model)[ Packagist](https://packagist.org/packages/phramz/composer-repository-model)[ RSS](/packages/phramz-composer-repository-model/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

php-composer-repository-model
=============================

[](#php-composer-repository-model)

[![Build Status](https://camo.githubusercontent.com/75dda7bee501eebe00d6a889cc55fbf63d4bef7165d465e624f81370dabde86c/68747470733a2f2f7472617669732d63692e6f72672f706872616d7a2f7068702d636f6d706f7365722d7265706f7369746f72792d6d6f64656c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/phramz/php-composer-repository-model) [![SensioLabsInsight](https://camo.githubusercontent.com/c128585ad01ebbb257205de7d60c5c5224e9370ecf7feaacd01758b332ac72f8/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f32303064623437352d366331342d343264642d393862652d3335613263613561376636652f6d696e692e706e67)](https://insight.sensiolabs.com/projects/200db475-6c14-42dd-98be-35a2ca5a7f6e) [![HHVM Status](https://camo.githubusercontent.com/83f6e728dab0581dddf8414b3e1d46933b3433bedf838379b337d5899ec0b0fc/687474703a2f2f6868766d2e683463632e64652f62616467652f706872616d7a2f636f6d706f7365722d7265706f7369746f72792d6d6f64656c2e706e67)](http://hhvm.h4cc.de/package/phramz/composer-repository-model) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/184e31933023915a9bd44e5cd047f9bcebe784bb51a9e809a7397185cff5b521/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706872616d7a2f7068702d636f6d706f7365722d7265706f7369746f72792d6d6f64656c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/phramz/php-composer-repository-model/?branch=master)

composer repository (aka `packages.json`) model builder component

With this library you'll be able to

- retrieve a `packages.json` from any repository (e.g. [Packagist](https://packagist.org) or a private [Satis](https://github.com/composer/satis)) reachable via HTTP
- serialize or deserialize the json-data
- build up an object-oriented model
- browse through the model, including referenced files like `includes` and `providers`

*This library is early alpha so keep in mind that anything may change in future releases!*

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

[](#requirements)

- PHP 5.3.3 or higher

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

[](#installation)

The best way to install is using [Composer](https://getcomposer.org):

- either edit your `composer.json` any add an requirement

```
"require": {
    "phramz/composer-repository-model": "dev-master"
}
```

- or let composer do that for you

```
php composer.phar require phramz/composer-repository-model

```

License
-------

[](#license)

This library is licensed under the MIT license. For further information see LICENSE file.

Configuration
-------------

[](#configuration)

There's no configuration at all, just use it.

Usage
-----

[](#usage)

```
use Phramz\Component\ComposerRepositoryModel\Service\RepositoryService;

// create an instance of the RepositoryService
$service = new RepositoryService();

// fetch and parse the `packages.json` from `https://packagist.org`
echo $service
    // [packages.json]
    ->buildModel(
        'https://packagist.org',
        'packages.json'
    )
    // [packages.json][provider-includes]
    ->getProviderIncludes()
    // [packages.json][provider-includes][p/provider-archived$%hash%.json]
    ->get('p/provider-2013$%hash%.json')
    // [packages.json][provider-includes][p/provider-archived$0123456789.json][providers]
    ->getProviders()
    // [packages.json][provider-includes][...][providers][p/phramz/doctrine-annotation-scanner$0123456789.json]
    ->get("phramz/doctrine-annotation-scanner")
    // [packages.json][provider-includes][...][providers][...][packages]
    ->getPackages()
    // [packages.json][provider-includes][...][providers][...][packages][phramz/doctrine-annotation-scanner]
    ->first()
    // [packages.json][provider-includes][...][providers][...][packages][...][v1.0.0]
    ->last()
    // [packages.json][provider-includes][...][providers][...][packages][...][v1.0.0][source]
    ->getSource()
    // [packages.json][provider-includes][...][providers][...][packages][...][v1.0.0][source][url]
    ->getUrl();

// ... will output `https://github.com/phramz/doctrine-annotation-scanner.git`
```

Known issues
------------

[](#known-issues)

- None, so far ...

Contributions
-------------

[](#contributions)

Pull-Requests are always welcome! If you're going to contribute please make sure that:

- your PR passes the travis-build
- your coding-style is PSR-2 compliant

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/508068ee645847a732a25a9cb05c3e125c6fe442a5bb5fe5e6968e37f1eb2dc4?d=identicon)[Maximilian Reichel](/maintainers/Maximilian%20Reichel)

---

Top Contributors

[![phramz](https://avatars.githubusercontent.com/u/2319696?v=4)](https://github.com/phramz "phramz (1 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

### Embed Badge

![Health badge](/badges/phramz-composer-repository-model/health.svg)

```
[![Health](https://phpackages.com/badges/phramz-composer-repository-model/health.svg)](https://phpackages.com/packages/phramz-composer-repository-model)
```

###  Alternatives

[wa72/htmlpagedom

jQuery-inspired DOM manipulation extension for Symfony's Crawler

3383.9M34](/packages/wa72-htmlpagedom)[shtumi/useful-bundle

Symfony ShtumiUsefulBundle

11099.5k](/packages/shtumi-useful-bundle)

PHPackages © 2026

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