Skip to content

Commit

Permalink
Add info about usage of assert()
Browse files Browse the repository at this point in the history
  • Loading branch information
lcobucci committed May 6, 2018
1 parent 246f4c6 commit 0feffc4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ you can install it using [Composer](http://getcomposer.org).
composer require lcobucci/di-builder
```

### PHP Configuration

In order to make sure that we're dealing with the correct data, we're using `assert()`,
which is a very interesting feature in PHP but not often used. The nice thing
about `assert()` is that we can (and should) disable it in production mode so
that we don't have useless statements.

So, for production mode, we recommend you to set `zend.assertions` to `-1` in your `php.ini`.
For development you should leave `zend.assertions` as `1` and set `assert.exception` to `1`, which
will make PHP throw an [`AssertionError`](https://secure.php.net/manual/en/class.assertionerror.php)
when things go wrong.

Check the documentation for more information: https://secure.php.net/manual/en/function.assert.php

## Basic usage

The usage is really simple, just trust the ```Lcobucci\DependencyInjection\Builder``` interface and
Expand Down

0 comments on commit 0feffc4

Please sign in to comment.