PHPackages                             20steps/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. 20steps/commons-ensure-bundle

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

20steps/commons-ensure-bundle
=============================

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

v1.0.6(8y ago)01.3k↓100%12LGPL-3.0+PHP

Since Dec 14Pushed 7y ago3 watchersCompare

[ Source](https://github.com/20steps/commons-ensure-bundle)[ Packagist](https://packagist.org/packages/20steps/commons-ensure-bundle)[ Docs](https://github.com/20steps/commons-ensure-bundle)[ RSS](/packages/20steps-commons-ensure-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (5)Used By (2)

20steps/commons-ensure-bundle (twentystepsCommonsEnsureBundle)
==============================================================

[](#20stepscommons-ensure-bundle-twentystepscommonsensurebundle)

[![Build Status](https://camo.githubusercontent.com/cd8b0e0f1732f934ed93ef9506da1b37ebfa9fecc36bf237bf9c77f596a021a1/68747470733a2f2f7472617669732d63692e6f72672f323073746570732f636f6d6d6f6e732d656e737572652d62756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/20steps/commons-ensure-bundle)[![Tested PHP Versions](https://camo.githubusercontent.com/d9b5acb7cbbc8ddb586ad4b919de0c4ca3c5d7b40ff4e7ab5f89f90159145332/687474703a2f2f7068702d6579652e636f6d2f62616467652f323073746570732f636f6d6d6f6e732d656e737572652d62756e646c652f7465737465642e737667)](https://travis-ci.org/20steps/commons-ensure-bundle)[![Dependency Status](https://camo.githubusercontent.com/bd2deacbd22bdf54271609bc5fa7c120e1287583a0bac79eaf32648ae6d3bfd2/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3538353432636334616439616132303034306363333766332f62616467652e7376673f7374796c653d666c61742d737175617265)](https://www.versioneye.com/user/projects/58542cc4ad9aa20040cc37f3)[![Packagist version](https://camo.githubusercontent.com/fb689f7a4c0e9291892e75e8530c84d2a29c8edbee4485ed7298f92abd67000e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f323073746570732f636f6d6d6f6e732d656e737572652d62756e646c652e737667)](https://packagist.org/packages/20steps/commons-ensure-bundle)

About
-----

[](#about)

The 20steps 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 20steps 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 20steps/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.

```
