PHPackages                             zenithsu/easy-rules - 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. zenithsu/easy-rules

ActiveLibrary

zenithsu/easy-rules
===================

Easy Rules is a PHP rules engine inspired by the easy rules project in java.

v1.0.0(2y ago)5638↓100%MITPHP

Since Apr 29Pushed 2y agoCompare

[ Source](https://github.com/ZenithInc/easy-rules)[ Packagist](https://packagist.org/packages/zenithsu/easy-rules)[ RSS](/packages/zenithsu-easy-rules/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Easy Rule Engine
----------------

[](#easy-rule-engine)

Easy Rules is a PHP rules engine inspired by the [easy-rules](https://github.com/j-easy/easy-rules) project in java.

Example
-------

[](#example)

### 1. First, define your rule...

[](#1-first-define-your-rule)

Either in a declarative way using annotations:

```
#[Rule(name: 'weather rule', description: 'if it rains then take an umbrella')]
class WeatherRule
{
    #[Condition]
    public function itRains(#[Fact(value: 'rain')] $fact, Facts $facts)
    {
        return $fact;
    }

    #[Action]
    public function takeAnUmbrella(): void
    {
        echo 'It rains, take an umbrella!';
    }
}
```

### 2. Then, fire it!

[](#2-then-fire-it)

Then ...

```
$facts = new Facts();
$facts->put('rain', true);

$weatherRule = new WeatherRule();
$rules = new Rules();
$rules->register($weatherRule);

$ruleEngine = new DefaultRulesEngine();
$ruleEngine->fire($rules, $facts);
```

License
-------

[](#license)

Easy Rules released under the terms of the MIT license:

```
The MIT License (MIT)

Copyright (c) 2024 Zenith Tech (happy@hacking.icu)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

740d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/93cb2a9e0d666c36bfdbcf2fd354e4b4e3539db6bd73ec7b64135550e27c3a2b?d=identicon)[SuZenith](/maintainers/SuZenith)

---

Top Contributors

[![SuZenith](https://avatars.githubusercontent.com/u/166780869?v=4)](https://github.com/SuZenith "SuZenith (1 commits)")

### Embed Badge

![Health badge](/badges/zenithsu-easy-rules/health.svg)

```
[![Health](https://phpackages.com/badges/zenithsu-easy-rules/health.svg)](https://phpackages.com/packages/zenithsu-easy-rules)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
