NoccyLabs

NoccyLabs develops open source libraries and software. With many projects ongoing, this organization contains public content repositories, as well as software and components considered stable.

noccylabs/composer-reflection (0.1.2)

Published 2025-12-29 13:35:29 +00:00 by noccy

Installation

{
	"repositories": [{
			"type": "composer",
			"url": ""
		}
	]
}
composer require noccylabs/composer-reflection:0.1.2

About this package

Reflect and enumerate installed composer packages

Composer Reflection

This library can be used to determine what other packages are installed as dependencies and performing basic filtering on properties and attributes. The below example can for example be used to get info on all packages having the type "some-plugin", namely in the form of a PackageManifest. You can also query for the paths if you so prefer:

// This is one way, giving you access to the composer manifest in the process
$plugins = NoccyLabs\ComposerReflection\PackageList::fromComposer()
            ->havingType("some-plugin")
            ->getManifests();
echo $plugins[0]->directory;

// But if you just want to dive into the filesystem, you can also get an array of
// paths representing the directories holding the composer.json files.
$paths = NoccyLabs\ComposerReflection\PackageList::fromComposer()
            ->havingType("some-plugin")
            ->getPaths();
echo $paths[0];

That is about it.

Installing

$ composer config repositories.noccylabs \
    '{"type":"composer","url":"https://dev.noccylabs.info/api/packages/noccylabs/composer"}'
$ composer require noccylabs/composer-reflection

Dependencies

Development Dependencies

ID Version
phpstan/phpstan ^2.1
psr/cache ^3.0
psr/container ^2.0
Details
Composer
2025-12-29 13:35:29 +00:00
1
Christopher Vagnetoft
GPL-2.0-or-later
11 KiB
Assets (1)
Versions (1) View all
0.1.2 2025-12-29