PHPackages                             barlito/utils - 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. barlito/utils

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

barlito/utils
=============

My personal library of utilities

v2.0.0(3w ago)0413mitPHPPHP &gt;=8.4CI passing

Since May 9Pushed 3w ago1 watchersCompare

[ Source](https://github.com/barlito/utils)[ Packagist](https://packagist.org/packages/barlito/utils)[ RSS](/packages/barlito-utils/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (30)Versions (23)Used By (0)

barlito/utils
=============

[](#barlitoutils)

[![CI](https://github.com/barlito/utils/actions/workflows/ci.yml/badge.svg)](https://github.com/barlito/utils/actions/workflows/ci.yml)

Personal library of Symfony utilities: Doctrine ID traits and reusable Behat contexts.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.4
- Symfony 7 or 8
- Doctrine ORM 3

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

[](#installation)

```
composer require barlito/utils
```

Usage
-----

[](#usage)

### Doctrine ID traits

[](#doctrine-id-traits)

Add a UUID or ULID primary key to an entity (generated by the Symfony bridge generators):

```
use Barlito\Utils\Traits\IdUuidTrait; // or IdUlidTrait
use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity]
class MyEntity
{
    use IdUuidTrait;
}
```

### Behat contexts

[](#behat-contexts)

Register the contexts in your `behat.yml` suite and wire them as services:

- `Barlito\Utils\Behat\Component\EntityManagerContext` — assert on database state:

```
Given a "User" entity found by "email=foo@bar.com" should match:
    | name | Foo |
Given a "User" entity found by "deletedAt:date=2024-01-01" should not exist
Given I should find 3 "User" entity found by "status=active"
Then I create a "User" entity with data:
    """
    {"email": "foo@bar.com"}
    """
```

- `Barlito\Utils\Behat\Component\LoggerContext` + `Barlito\Utils\Behat\Mock\LoggerMock` — decorate the logger in test env with `LoggerMock`, then:

```
Then the logger logged the error with message "Something went wrong"
Then the logger logged an error containing "went wrong"
```

### Reusable QA configs

[](#reusable-qa-configs)

The `config/` directory ships ready-to-use QA configs for consuming projects (install the tools in your own `require-dev`):

**PHPStan** — `phpstan.dist.neon`:

```
includes:
    - vendor/barlito/utils/config/phpstan.neon

parameters:
    paths:
        - src
```

**Rector** — `rector.php`:

```
$builder = require 'vendor/barlito/utils/config/rector.php';

return $builder
    ->withPaths([__DIR__ . '/src'])
    ->withCache(__DIR__ . '/var/cache/rector');
```

**PHP-CS-Fixer** — run with the shipped config (paths resolve from your project root):

```
vendor/bin/php-cs-fixer fix --config=vendor/barlito/utils/config/.php-cs-fixer.dist.php
```

**PHPCS** (PSR-12):

```
vendor/bin/phpcs --standard=vendor/barlito/utils/config/phpcs.xml.dist src
```

**PHPMD**:

```
vendor/bin/phpmd src text vendor/barlito/utils/config/phpmd.xml
```

Development
-----------

[](#development)

```
make deploy        # start the dev container
make phpstan       # static analysis (level 8)
make cs            # coding standards check (php-cs-fixer, @Symfony)
make cs-fix        # apply coding standards
make rector        # rector dry-run
make rector-fix    # apply rector rules
make phpcs         # PSR-12 check (phpcs)
make phpmd         # mess detection (phpmd, isolated via vendor-bin)
make qa            # run the whole QA suite
```

The same commands are available as composer scripts (`composer phpstan`, `composer cs`, `composer rector`, ...).

###  Health Score

53

—

FairBetter than 96% of packages

Maintenance95

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity76

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

Recently: every ~118 days

Total

17

Last Release

24d ago

Major Versions

v1.9.0 → v2.0.02026-06-09

PHP version history (4 changes)v1.0.0PHP &gt;=8.0.2

v1.1.3PHP &gt;=8.1

v1.6PHP &gt;=8.2

v2.0.0PHP &gt;=8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/0c086c7f4751b9a39a8935868dfa5f6f9f8f6bb78dc54c955d069ba6712bfc21?d=identicon)[barlito](/maintainers/barlito)

---

Top Contributors

[![barlito](https://avatars.githubusercontent.com/u/24959916?v=4)](https://github.com/barlito "barlito (32 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/barlito-utils/health.svg)

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

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M386](/packages/easycorp-easyadmin-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[sylius/sylius

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

8.5k5.9M737](/packages/sylius-sylius)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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