PHPackages                             spartaksun/get-in-packages-composer.jason - 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. spartaksun/get-in-packages-composer.jason

ActiveLibrary

spartaksun/get-in-packages-composer.jason
=========================================

Functions around joshdifabio/composed and igorw/get-in to gather configuration from composer.json

1.0.2(5y ago)01.6k1MITPHPPHP ^8.0

Since Jun 19Pushed 5y agoCompare

[ Source](https://github.com/spartaksun/php-get-in-packages-composer.json)[ Packagist](https://packagist.org/packages/spartaksun/get-in-packages-composer.jason)[ RSS](/packages/spartaksun-get-in-packages-composerjason/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (3)Versions (4)Used By (1)

Get In Packages' composer.json
==============================

[](#get-in-packages-composerjson)

[![Build Status](https://camo.githubusercontent.com/94c3d531e4045b1b9a094632c01407e25bf46dad608238a1cb1833df5ef731d6/68747470733a2f2f7472617669732d63692e6f72672f57797269486178696d75732f7068702d6765742d696e2d7061636b616765732d636f6d706f7365722e6a61736f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/WyriHaximus/php-get-in-packages-composer.jason)[![Latest Stable Version](https://camo.githubusercontent.com/ff5070767dc4f909aff6c9040004aeb9d32a60b523f9dc56ed09b337de4d4287/68747470733a2f2f706f7365722e707567782e6f72672f77797269686178696d75732f6765742d696e2d7061636b616765732d636f6d706f7365722e6a61736f6e2f762f737461626c652e706e67)](https://packagist.org/packages/wyrihaximus/get-in-packages-composer.jason)[![Total Downloads](https://camo.githubusercontent.com/72e059b518888aedb1285bdec707e1c0cefab5b700653de51d7c2274ca2a31a0/68747470733a2f2f706f7365722e707567782e6f72672f77797269686178696d75732f6765742d696e2d7061636b616765732d636f6d706f7365722e6a61736f6e2f646f776e6c6f6164732e706e67)](https://packagist.org/packages/wyrihaximus/get-in-packages-composer.jason/stats)[![Code Coverage](https://camo.githubusercontent.com/6ede4647b914cc407f04e59b1d049919c4f57325b3acf39463ebe8cae4f88bab/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f57797269486178696d75732f7068702d6765742d696e2d7061636b616765732d636f6d706f7365722e6a61736f6e2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/WyriHaximus/php-get-in-packages-composer.jason/?branch=master)[![License](https://camo.githubusercontent.com/f13c422a12c0bd399361274a36a1662eb77b6e42aa88d7f78ca318b33bf8deb2/68747470733a2f2f706f7365722e707567782e6f72672f77797269686178696d75732f6765742d696e2d7061636b616765732d636f6d706f7365722e6a61736f6e2f6c6963656e73652e706e67)](https://packagist.org/packages/wyrihaximus/get-in-packages-composer.jason)[![PHP 7 ready](https://camo.githubusercontent.com/08c46d269002473528ea501834233c36a8b002c228e326ba0147ad9cfa73998c/687474703a2f2f7068703772656164792e74696d6573706c696e7465722e63682f57797269486178696d75732f7068702d6765742d696e2d7061636b616765732d636f6d706f7365722e6a61736f6e2f62616467652e737667)](https://appveyor-ci.org/WyriHaximus/php-get-in-packages-composer.jason)

Installation
============

[](#installation)

To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `^`.

```
composer require wyrihaximus/get-in-packages-composer.jason

```

Functions
=========

[](#functions)

The following examples are made with the following `composer.json` in mind:

```
{
    "extra": {
        "react-inspector": {
            "metrics": [
                "ticks.future.current",
                "ticks.future.total",
                "ticks.future.ticks",
                "signals.current",
                "signals.total",
                "signals.ticks"
            ],
            "reset": {
                "ticks": [
                    "ticks.future.ticks",
                    "signals.ticks"
                ]
            }
        },
        "reactive-apps": {
            "command": {
                "ReactiveApps\\Command\\HttpServer\\Command": "src/Command"
            },
            "config": [
                "etc/config/app.php",
                "etc/config/http-server.php",
                "etc/config/supervisor.php"
            ]
        }
    }
}
```

get\_in\_packages\_composer
---------------------------

[](#get_in_packages_composer)

Get the config for the given key for all packages that have it. Passed the Package instance as key and config from `composer.json` as value:

```
/**
 * @var Composed\Package $package
 * @var mixed            $config
 */
foreach (get_in_packages_composer('extra') as $package => $config) {
    $packagesConfig->add($package, $config);
}
```

from\_get\_in\_packages\_composer
---------------------------------

[](#from_get_in_packages_composer)

Same as `get_in_packages_composer` but `yield from`'s the items in each package:

```
foreach (from_get_in_packages_composer('extra.react-inspector.metrics') as $item) {
    // $item: [
    // ticks.future.current,
    // ticks.future.total,
    // ticks.future.ticks,
    // signals.current,
    // signals.total,
    // signals.ticks,
    // ]
}
```

get\_in\_packages\_composer\_path
---------------------------------

[](#get_in_packages_composer_path)

Building on `get_in_packages_composer`, `get_in_packages_composer_path` iterates over all the config items per package coming back from `get_in_packages_composer` and gets the full path for the given items value. This is handy for for example configuration autodiscovery:

```
foreach (get_in_packages_composer_path('extra.reactive-apps.config') as $path) {
    $config->loadFromFile($path);
}
```

get\_in\_packages\_composer\_with\_path
---------------------------------------

[](#get_in_packages_composer_with_path)

Works the same as `get_in_packages_composer_path` but instead of down a full path per item it use that full path for the item as key and the items key and value. Handy for scanning a file directory and having the namespace for the root present:

```
foreach (get_in_packages_composer_with_path('extra.reactive-apps.command') as $path => $namespacePrefix) {
    $commands->scan($path, $namespacePrefix);
}
```

License
=======

[](#license)

The MIT License (MIT)

Copyright (c) 2018 Cees-Jan Kiewiet

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 55.8% 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 ~477 days

Total

3

Last Release

1930d ago

PHP version history (2 changes)1.0.0PHP ^7.2

1.0.2PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/065df9e5ff6cedd80cf8a49ca639578e8b9386b40841a1f11c5c63468620d4e0?d=identicon)[spartaksun](/maintainers/spartaksun)

---

Top Contributors

[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (29 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (13 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (9 commits)")[![spartaksun](https://avatars.githubusercontent.com/u/6684190?v=4)](https://github.com/spartaksun "spartaksun (1 commits)")

### Embed Badge

![Health badge](/badges/spartaksun-get-in-packages-composerjason/health.svg)

```
[![Health](https://phpackages.com/badges/spartaksun-get-in-packages-composerjason/health.svg)](https://phpackages.com/packages/spartaksun-get-in-packages-composerjason)
```

###  Alternatives

[geocoder-php/geo-plugin-provider

Geocoder GeoPlugin adapter

975.0M8](/packages/geocoder-php-geo-plugin-provider)[foil/foil

PHP template engine for native PHP templates

170111.2k7](/packages/foil-foil)[api-clients/command-bus

Light weight wrapper around league/tactician adding promised based interface(s) and next tick execution

11196.7k4](/packages/api-clients-command-bus)[pre/plugin

941.4k3](/packages/pre-plugin)[americanexpress/hyperledger-fabric-sdk-php

Hyperledger Fabric client SDK in PHP

491.3k](/packages/americanexpress-hyperledger-fabric-sdk-php)

PHPackages © 2026

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