PHPackages                             schnittstabil/composer-extra - 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. schnittstabil/composer-extra

ActiveLibrary

schnittstabil/composer-extra
============================

Get namespaced configuration from composer.json `extra`

2.1.0(8y ago)215.8k9MITPHPPHP &gt;=5.6.0

Since Apr 3Pushed 8y ago1 watchersCompare

[ Source](https://github.com/schnittstabil/composer-extra)[ Packagist](https://packagist.org/packages/schnittstabil/composer-extra)[ RSS](/packages/schnittstabil-composer-extra/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (12)Used By (9)

ComposerExtra [![Build Status](https://camo.githubusercontent.com/5748df5f9c06b8523c82247a3e0766e13fb1a6e3ff98b33873987f32104fbd6e/68747470733a2f2f7472617669732d63692e6f72672f7363686e69747473746162696c2f636f6d706f7365722d65787472612e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/schnittstabil/composer-extra) [![Coverage Status](https://camo.githubusercontent.com/616d798fc2954f1e294a745fca951b56c74ee32084ad804af0c86f85a43a652c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f7363686e69747473746162696c2f636f6d706f7365722d65787472612f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/schnittstabil/composer-extra?branch=master) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/d96768f1e1aaba025294bda885d42631b5482c0a4c1288b54b031d69d619f1d9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7363686e69747473746162696c2f636f6d706f7365722d65787472612f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/schnittstabil/composer-extra/?branch=master) [![Code Climate](https://camo.githubusercontent.com/3289df71eff4f9763bb6fcc57320de6b4c8a025074b90333d065b735384ac7ab/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f7363686e69747473746162696c2f636f6d706f7365722d65787472612f6261646765732f6770612e737667)](https://codeclimate.com/github/schnittstabil/composer-extra)
=============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#composerextra----)

[![SensioLabsInsight](https://camo.githubusercontent.com/08da0b83af1ce38db3fa5dc9698a49f7e545b1bc3dccaa8bd35e5ccea7b4d45f/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f37356239356631612d663034372d346163332d626138392d3162343234363239646639342f6269672e706e67)](https://insight.sensiolabs.com/projects/75b95f1a-f047-4ac3-ba89-1b424629df94)

> Get namespaced configuration from composer.json `extra`.

Install
-------

[](#install)

```
$ composer require schnittstabil/composer-extra
```

Typical Usage
-------------

[](#typical-usage)

### End User

[](#end-user)

```
{
    "name": "end-user/project",
    "require": {
        "you/your-awesome-library": "*"
    },
    "extra": {
        "you/your-awesome-library": {
            "unicorns": 42
        }
    },
}
```

### Your Library

[](#your-library)

```
require __DIR__.'/vendor/autoload.php';

# get end-user configuration
$config = new Schnittstabil\ComposerExtra\ComposerExtra('you/your-awesome-library');
$config->get('unicorns') //=> int(42)
```

API
---

[](#api)

```
namespace Schnittstabil\ComposerExtra;

/**
 * Get namespaced configuration from `composer.json`.
 */
class ComposerExtra
{
    /**
     * Create a new ComposerExtra.
     *
     * @see https://github.com/schnittstabil/get Documentation of `Schnittstabil\Get\getValue`.
     *
     * @param string|int|mixed[] $namespace     a `Schnittstabil\Get\getValue` path
     * @param mixed              $defaultConfig default configuration
     * @param string             $presetsPath   presets path (w/o namespace)
     *
     * @throws \KHerGe\File\Exception\ResourceException
     * @throws \Seld\JsonLint\ParsingException
     */
    public function __construct($namespace = array(), $defaultConfig = null, $presetsPath = null);

    /**
     * Get configuration value.
     *
     * @see https://github.com/schnittstabil/get Documentation of `Schnittstabil\Get\getValue`.
     *
     * @param string|int|mixed[] $path    a `Schnittstabil\Get\getValue` path
     * @param mixed              $default default value if $path is not valid
     *
     * @return mixed the value determined by `$path` or otherwise `$default`
     */
    public function get($path = array(), $default = null);

    /**
     * Get configuration value.
     *
     * @see https://github.com/schnittstabil/get Documentation of `Schnittstabil\Get\getValueOrFail`.
     *
     * @param string|int|mixed[] $path    a `Schnittstabil\Get\getValueOrFail` path
     * @param mixed              $message exception message
     *
     * @throws \OutOfBoundsException if `$path` is not valid
     *
     * @return mixed the value determined by `$path`
     */
    public function getOrFail($path = array(), $message = null);
}
```

License
-------

[](#license)

MIT © [Michael Mayer](http://schnittstabil.de)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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 ~71 days

Recently: every ~135 days

Total

11

Last Release

2975d ago

Major Versions

0.6.0 → 1.0.02016-09-26

1.0.1 → 2.0.02017-02-13

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6059032?v=4)[Michael Mayer](/maintainers/schnittstabil)[@schnittstabil](https://github.com/schnittstabil)

---

Top Contributors

[![schnittstabil](https://avatars.githubusercontent.com/u/6059032?v=4)](https://github.com/schnittstabil "schnittstabil (21 commits)")

---

Tags

composerconfigurationextracomposer.json

### Embed Badge

![Health badge](/badges/schnittstabil-composer-extra/health.svg)

```
[![Health](https://phpackages.com/badges/schnittstabil-composer-extra/health.svg)](https://phpackages.com/packages/schnittstabil-composer-extra)
```

###  Alternatives

[symfony/options-resolver

Provides an improved replacement for the array\_replace PHP function

3.2k493.9M1.6k](/packages/symfony-options-resolver)[jean85/pretty-package-versions

A library to get pretty versions strings of installed dependencies

1.3k289.5M62](/packages/jean85-pretty-package-versions)[league/config

Define configuration arrays with strict schemas and access values with dot notation

564302.2M24](/packages/league-config)[twig/extra-bundle

A Symfony bundle for extra Twig extensions

91292.0M313](/packages/twig-extra-bundle)[dealerdirect/phpcodesniffer-composer-installer

PHP\_CodeSniffer Standards Composer Installer Plugin

596161.9M1.9k](/packages/dealerdirect-phpcodesniffer-composer-installer)[ergebnis/composer-normalize

Provides a composer plugin for normalizing composer.json.

1.1k37.3M2.1k](/packages/ergebnis-composer-normalize)

PHPackages © 2026

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