A lightweight PHP library to check Composer dependencies and environment at runtime.
Composition is a PHP library that allows developers to check Composer dependencies and environment conditions at runtime. It solves the problem of manually verifying package versions, PHP extensions, and platform specifics by providing a clean, programmatic API.
PHP developers using Composer for dependency management, particularly those writing unit tests or applications requiring runtime environment validation.
Developers choose Composition for its lightweight, generic API that simplifies dependency checks, reduces boilerplate code, and improves maintainability compared to manual regex or constant-based validation.
Check your Composer dependencies at runtime.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides a clean API to check Composer package versions and existence, as shown in the README example using `\Composition::has('vendor/super-package', '>=2.0')` for conditionally skipping tests.
Includes built-in methods like `isWindows()` for platform checks, eliminating manual OS detection code and simplifying cross-platform logic.
Enables easy validation of PHP versions and extensions with simple syntax, such as `\Composition::has('php', '5.4.*')` or `\Composition::has('ext-mongo')` from the README examples.
Reduces boilerplate by replacing regex or constant-based checks with a lightweight, generic API, aligning with its simplicity-focused philosophy described in the documentation.
Only functions with Composer, making it useless for projects using other package managers or no package manager, as stated in the README: 'It only works when using Composer as package management tool.'
The README explicitly advises against production use with 'This tool should mostly be used in your unit tests, and not be abused in production,' restricting its utility to development scenarios.
Focuses on simple checks without support for complex dependency graphs, custom error messages, or integration with advanced tooling, which may not suffice for all validation needs.