PHPackages                             watoki/karma - 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. watoki/karma

ActiveLibrary

watoki/karma
============

Event sourcing library for PHP

0194PHP

Since Jan 19Pushed 9y agoCompare

[ Source](https://github.com/watoki/karma)[ Packagist](https://packagist.org/packages/watoki/karma)[ RSS](/packages/watoki-karma/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Karma [![Build Status](https://camo.githubusercontent.com/a16413fa13315956f2c8ad56d855b928e3be7827ce1fb78da60fbced58aff75b/68747470733a2f2f7472617669732d63692e6f72672f7761746f6b692f6b61726d612e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/watoki/karma)
=========================================================================================================================================================================================================================================================================

[](#karma-)

*karma* is an [event sourcing](http://martinfowler.com/eaaDev/EventSourcing.html) library for PHP. It helps you to

- [handle commands](http://github.com/watoki/karma/tree/master/spec/usage/HandleCommandsSpec.php)
- [store events](http://github.com/watoki/karma/tree/master/spec/usage/StoreEventsSpec.php)
- [protect invariants](http://github.com/watoki/karma/tree/master/spec/usage/ProtectInvariantsSpec.php)
- [react to events](http://github.com/watoki/karma/tree/master/spec/usage/ReactToEventsSpec.php)
- [project events](http://github.com/watoki/karma/tree/master/spec/usage/ProjectEventsSpec.php)
- test an application

The name refers to the [principle of cause and effect](https://en.wikipedia.org/wiki/Karma) where all actions of an entity influence the future of that entity. Hence the state of the world is only the sum of all events of the past. This is also the principle of [event sourcing](http://martinfowler.com/eaaDev/EventSourcing.html).

> Shallow men believe in luck or in circumstance. Strong men believe in cause and effect.
> Ralph Waldo Emerson

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

[](#installation)

To use *karma* in your project, require it with [Composer](http://getcomposer.org/download/)

```
composer require watoki/karma

```

If you would like to develop on *karma*, clone it with [git](https://git-scm.com/), download its dependencies with [composer](http://getcomposer.org/download/) and execute the specification with [scrut](https://github.com/rtens/scrut).

```
git clone https://github.com/watoki/karma.git
cd karma
composer install
vendor/bin/scrut

```

Documentation
-------------

[](#documentation)

The documentation of *karma* is written in the form of an executable specification. You find it in the [`spec`](http://github.com/watoki/karma/tree/master/spec) folder.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e687108526c164e4ad1c49b8228514541bd90d43ef70665a087d00e34a1f7559?d=identicon)[rtens](/maintainers/rtens)

---

Top Contributors

[![rtens](https://avatars.githubusercontent.com/u/1468866?v=4)](https://github.com/rtens "rtens (25 commits)")

### Embed Badge

![Health badge](/badges/watoki-karma/health.svg)

```
[![Health](https://phpackages.com/badges/watoki-karma/health.svg)](https://phpackages.com/packages/watoki-karma)
```

PHPackages © 2026

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