Popularity
2.3
Stable
Activity
0.0
Stable
108
7
5

Description

Composition provides a lightweight and generic API, that you can use to check your environment at runtime, instead of manually go checking for regex in constants, classes/functions existence, matching a version against a class constant, ...

It only works when using Composer as package management tool.

Programming language: PHP
License:
Latest version: v1.0.0

Composition alternatives and similar libraries

Based on the "Dependency Management Extras" category.
Alternatively, view Composition alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of Composition or a related project?

Add another 'Dependency Management Extras' Library

README

Composition Build Status

Composition provides a lightweight and generic API, that you can use to check your environment at runtime, instead of manually go checking for regex in constants, classes/functions existence, matching a version against a class constant, ...

It only works when using Composer as package management tool.

Some examples

A single command to check your PHP environment :

if (!\Composition::has('vendor/super-package', '>=2.0') {
    $this->markTestSkipped('The following tests require "SuperPackage" to be at least at 2.0');
}

\Composition::has('php', '5.4.*');
\Composition::has('ext-mongo');

Check the platform :

if (\Composition::isWindows()) {
// ...
}

Note

This tool should mostly be used in your unit tests, and not be abused in production.