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.2About 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 |