PHPackages                             campanda/commons-ensure-bundle - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. campanda/commons-ensure-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

campanda/commons-ensure-bundle
==============================

Symfony bundle with static helper functions for checking coding pre-/post-conditions

v1.0.10(7y ago)02.3kLGPL-3.0+PHP

Since Dec 14Pushed 7y ago2 watchersCompare

[ Source](https://github.com/campanda/commons-ensure-bundle)[ Packagist](https://packagist.org/packages/campanda/commons-ensure-bundle)[ Docs](https://github.com/campanda/commons-ensure-bundle)[ RSS](/packages/campanda-commons-ensure-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (2)Versions (12)Used By (0)

Campanda/commons-ensure-bundle (campandaCommonsEnsureBundle)
============================================================

[](#campandacommons-ensure-bundle-campandacommonsensurebundle)

About
-----

[](#about)

The Campanda Commons Ensure Bundle contains static helper functions for checking coding pre-/post-conditions. The check helps to fail early with a EnsureException in the case of missmatched assertions with a meaningful sprintf format message. In comparison to PHP's assert() command, the ensure checks are always enabled.

The Campanda Commons Ensure Bundle is licensed under the LGPL license version 3.0 ().

Installation
------------

[](#installation)

1. Add the bundle to your composer.json and download a matching version by calling

```
composer require campanda/common-ensure-bundle
```

Prerequisite: Install [**Composer**](https://getcomposer.org/), the dependency manager used by modern PHP applications.

Usage
-----

[](#usage)

The following code shows some simple method call using the Ensure Bundle.

```
