PHPackages                             delboy1978uk/common - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. delboy1978uk/common

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

delboy1978uk/common
===================

Stuff that winds up in every project

v4.1.2(6y ago)02.8k1MITPHP

Since Dec 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/delboy1978uk/common)[ Packagist](https://packagist.org/packages/delboy1978uk/common)[ RSS](/packages/delboy1978uk-common/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (2)Dependencies (7)Versions (74)Used By (1)

common
======

[](#common)

[![Build Status](https://camo.githubusercontent.com/4ff6bae2cd54048ce242a334cf8a4cc94a7b9230c6bcdac6e717d4e55e86c247/68747470733a2f2f7472617669732d63692e6f72672f64656c626f7931393738756b2f636f6d6d6f6e2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/delboy1978uk/common) [![Code Coverage](https://camo.githubusercontent.com/a503ef87250f9823e4305c9dba08d1596ff30a6dde2bb0143000bceb8eb5558b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64656c626f7931393738756b2f636f6d6d6f6e2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/delboy1978uk/common/?branch=master) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/a21ffce76ee82b0b37de47291d7d1c89501f36ee08b3d7830e41bc3a8aaf6377/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64656c626f7931393738756b2f636f6d6d6f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/delboy1978uk/common/?branch=master)
Stuff that winds up in every project.

Db Credentials
--------------

[](#db-credentials)

Set the db credentials by passing an array

```
use Del\Common\Config\DbCredentials;

$credentials = new DbCredentials([
    'driver' => 'pdo_mysql',
    'dbname' => 'delboy1978uk',
    'user' => 'dbuser',
    'password' => '[123456]',
]);
```

DIC Container Factory Service
-----------------------------

[](#dic-container-factory-service)

```
use Del\Common\ContainerService;

$containerSvc = ContainerService::getInstance();
```

Service Methods
---------------

[](#service-methods)

```
$containerSvc->setDbCredentials($credentials); // Do this before getContainer() to configure the DBAL Connection
$containerSvc->addEntityPath('path/to/entities'); // You can add multiple paths to get Entities from different packages
$containerSvc->registerToContainer($registrationInterface); // See below
```

Container Registration Interface
--------------------------------

[](#container-registration-interface)

You can create a class in your own packages that will register any definitions that go in the container. Just implement Barnacle\\RegistrationInterface. E.g.

```
namespace My\Config\Container;

use Barnacle\Container;
use Barnacle\RegistrationInterface;
use Doctrine\ORM\EntityManager;
use My\Repository\Dog as DogRepository;

class DogPackage implements RegistrationInterface
{
    /**
     * @param Container $c
     */
    public function addToContainer(Container $c)
    {
        $c['repository.dog'] = $c->factory(function ($c) {
            /** @var EntityManager $em */
            $em = $c['doctrine.entity_manager'];
            /** @var DogRepository $repo */
            $repo = $em->getRepository('My\Entity\Dog');
            return $repo;
        });
    }
}
```

Pimple Container
----------------

[](#pimple-container)

A Dependency Injection container. Which now contains a configured Doctrine 2 Entity Manager

```
$container = $containerSvc->getContainer();
$em = $container['doctrine.entity_manager'];
$dogRepo = $container['repository.dog'];

```

Value Objects
-------------

[](#value-objects)

There have several value objects which extend Del\\Common\\Value\\AbstractValue.

```
use Del\Common\Value\DecimalValue;
use Del\Common\Value\IntValue;
use Del\Common\Value\StringValue;

$money = new DecimalValue(123.45);
$text = new StringValue('Hooray');
$int = new IntValue(500);

echo $money->getValue();
echo $text->getValue();
echo $int->getValue();
```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity78

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 ~22 days

Recently: every ~1 days

Total

72

Last Release

2329d ago

Major Versions

v1.0.1a → v2.0.02016-01-06

v2.4.3 → v3.0.02018-06-22

v3.1.1 → v4.0.02019-09-14

### 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 (154 commits)")

###  Code Quality

TestsCodeception

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k6.0M776](/packages/sylius-sylius)[azuracast/azuracast

The AzuraCast self-hosted web radio station management suite.

4.0k27.9k](/packages/azuracast-azuracast)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

5.2k5.6k](/packages/shlinkio-shlink)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M231](/packages/sulu-sulu)

PHPackages © 2026

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