<commit_before># BusinessRulesEngine

POC of minimalist BusinessRulesEngine with Symfony 2.4 ExpressionLanguage component.

This package contains two component:

+ `Hal\Component\BusinessRulesEngine\Collection`: collection filtered with business rules
+ `BRE`: evaluation function

# Installation

    curl -sS https://getcomposer.org/installer | php
    php composer.phar install

# Usage

### Business rules

```php
class User { public $age = 25; }
$user = new User;

BRE('user => user.age > 18', $user); // true
BRE('user => user.age > 18', $user); // false
BRE('user => user.age > 18 and user.age < 45', $user); // true

// you can provide multiple variables as following:
BRE('user.age > 1required', array('foo' => $user, 'required' 18); // true
<commit_msg>typo in documentation<commit_after># BusinessRulesEngine

POC of minimalist BusinessRulesEngine with Symfony 2.4 ExpressionLanguage component.

This package contains two component:

+ `Hal\Component\BusinessRulesEngine\Collection`: collection filtered with business rules
+ `BRE`: evaluation function

# Installation

    curl -sS https://getcomposer.org/installer | php
    php composer.phar install

# Usage

### Business rules

```php
class User { public $age = 25; }
$user = new User;

BRE('user => user.age > 18', $user); // true
BRE('user => user.age > 18', $user); // false
BRE('user => user.age > 18 and user.age < 45', $user); // true

// you can provide multiple variables as following:
BRE('user.age > required', array('foo' => $user, 'required' 18); // true

{'fraction_non_alphanumeric': 0.136986301369863, 'fraction_numerical': 0.018917155903457272, 'mean_word_length': 4.235494880546075, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1386299', 'n_tokens_mistral': 498, 'n_tokens_neox': 446, 'n_words': 156}