PHPackages                             subiabre/doctrine-snowflakes - 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. subiabre/doctrine-snowflakes

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

subiabre/doctrine-snowflakes
============================

Custom id generator implementing snowflake algorithm

2.0(2y ago)0259MITPHPCI passing

Since Aug 4Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/subiabre/doctrine-snowflakes)[ Packagist](https://packagist.org/packages/subiabre/doctrine-snowflakes)[ RSS](/packages/subiabre-doctrine-snowflakes/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (3)Versions (6)Used By (0)

SnowflakeGenerator
==================

[](#snowflakegenerator)

ID Generator for Doctrine implementing the Snowflake algorithm.

Install
=======

[](#install)

```
$ composer require subiabre/doctrine-snowflakes
```

Usage
=====

[](#usage)

In your entity classes:

```
#[ORM\Id()]
#[ORM\GeneratedValue(strategy: "CUSTOM")]
#[ORM\CustomIdGenerator(class: SnowflakeGenerator::class)]
#[ORM\Column(type: Types::BIGINT]
private string $id;
```

Take in consideration that PHP does not have a proper `bigint` data type. Due to this limitation, doctrine-snowflake IDs should be used as `string`.

```
public function getId(): string
```

Testing
=======

[](#testing)

This package includes unit tests with the PHPUnit library. Run the tests with:

```
./vendor/bin/phpunit
```

The default test cases test against concurrency and uniqueness in 10 batches of 300 IDs each batch, alternatively you can supply any batch size with:

```
BATCH_SIZE=1000 ./vendor/bin/phpunit
```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance57

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% 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 ~398 days

Total

4

Last Release

963d ago

Major Versions

1.1.1 → 2.02023-11-13

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/61125897?v=4)[Daniel Subiabre García](/maintainers/subiabre)[@subiabre](https://github.com/subiabre)

---

Top Contributors

[![subiabre](https://avatars.githubusercontent.com/u/61125897?v=4)](https://github.com/subiabre "subiabre (20 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/subiabre-doctrine-snowflakes/health.svg)

```
[![Health](https://phpackages.com/badges/subiabre-doctrine-snowflakes/health.svg)](https://phpackages.com/packages/subiabre-doctrine-snowflakes)
```

###  Alternatives

[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)

PHPackages © 2026

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