PHPackages                             delboy1978uk/expenses - 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. delboy1978uk/expenses

ActiveLibrary

delboy1978uk/expenses
=====================

A money in money out thing

v2.1.9(8y ago)041MITPHP

Since Mar 20Pushed 8y ago1 watchersCompare

[ Source](https://github.com/delboy1978uk/expenses)[ Packagist](https://packagist.org/packages/delboy1978uk/expenses)[ RSS](/packages/delboy1978uk-expenses/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (18)Used By (0)

Expenses
========

[](#expenses)

[![Build Status](https://camo.githubusercontent.com/ccec56c0f9eb99df3940c75e78f686248f9685f4dae3cdef3f6538c10e26cc28/68747470733a2f2f7472617669732d63692e6f72672f64656c626f7931393738756b2f657870656e7365732e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/delboy1978uk/expenses) [![Code Coverage](https://camo.githubusercontent.com/97d8b8ffff9a357ff444cb7d90857f816b6b6b26caf7143ef1039599a2c786ce/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64656c626f7931393738756b2f657870656e7365732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/delboy1978uk/expenses/?branch=master) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/f00cb658040bd6d7303f3eeb18737657b2e7273c8adb4e109c04a45aedda076f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64656c626f7931393738756b2f657870656e7365732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/delboy1978uk/expenses/?branch=master)
A simple service for storing money in and money out.

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

[](#installation)

Install the package using composer:

```
composer require delboy1978uk/expenses

```

### Database Setup

[](#database-setup)

Create a migrant-cfg.php based on vendor/delboy1978uk/common/migrant-cfg.php.dist and add delboy1978uk/expenses in the packages section. Then run:

```
migrant migrate

```

### Common Package Registration

[](#common-package-registration)

Expenses works with delboy1978uk/common, which has a Doctrine Entity Manager and a Pimple DIC. Register with the Del\\Expenses\\ExpensesPackage to the container.

```
use Del\Common\ContainerService;
use Del\Expenses\ExpensesPackage;

$package = new ExpensesPackage();
ContainerService::getInstance()->registerToContainer($package);
```

The Expenses Service
--------------------

[](#the-expenses-service)

```
$container = ContainerService::getInstance()->getContainer();
$svc = $container['service.expenses'];
```

### Service Methods

[](#service-methods)

```
$svc->createIncomeFromArray($data);
$svc->createExpenditureFromArray($data);
$svc->createExpenseClaimFromArray($data);
$svc->toArray($entity);
$svc->saveIncome($entity);
$svc->saveExpenditure($entity);
$svc->saveExpenseClaim($entity);
$svc->deleteIncome($entity);
$svc->deleteExpenditure($entity);
$svc->deleteExpenseClaim($entity);
$svc->deleteEntry($entity);
$svc->findByCriteria($criteria);
$svc->findIncomeById($id);
$svc->findExpenditureById($id);
$svc->findExpenseClaimById($id);
$svc->findExpenseClaimById($id);
$svc->saveIncome($income);
$svc->saveExpenditure($expenditure);
$svc->saveExpenseClaim($claim);
```

Entities
--------

[](#entities)

There are three types of entity, which all extend abstract class Entry, Income, Expenditure, and Expense Claim. Income and Expenditure are enough for a sole trader, someone with a limited company can use a ExpenseClaim entity to make an Expenditure that came out your own pocket that you can claim back from the business. All in order to figure out your taxable pay. An EntryInterface has the following methods:

```
$entity->getId();
$entity->getUserId();
$entity->getDate();
$entity->getAmount();
$entity->getDescription();
$entity->getNote();
$entity->getCategory();
$entity->getType();
```

Criteria
--------

[](#criteria)

Searching the DB is simple using a Criteria object:

```
use Del\Expenses\Criteria\EntryCriteria;

$criteria = new Criteria();
$criteria->setUserId(42);
$criteria->setType('IN'); // also OUT or CLAIM
$criteria->setOrder(Criteria::ORDER_DATE);
$criteria->setLimit(25);
$criteria->setOffset(74);

$results = $svc->findByCriteria($criteria);
```

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity72

Established project with proven stability

 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

Every ~40 days

Recently: every ~14 days

Total

17

Last Release

3067d ago

Major Versions

v1.0.3 → v2.0.02017-06-18

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/delboy1978uk-expenses/health.svg)

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

PHPackages © 2026

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