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

ActiveLibrary

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

Custom id generator implementing snowflake algorithm

2.0(2y ago)0242MITPHPCI passing

Since Aug 4Pushed 3mo 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 2d 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

36

—

LowBetter than 82% of packages

Maintenance54

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95% 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

911d ago

Major Versions

1.1.1 → 2.02023-11-13

### Community

Maintainers

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

---

Top Contributors

[![subiabre](https://avatars.githubusercontent.com/u/61125897?v=4)](https://github.com/subiabre "subiabre (19 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 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

[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)[api-platform/doctrine-orm

Doctrine ORM bridge

243.1M39](/packages/api-platform-doctrine-orm)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)[pixelfederation/doctrine-resettable-em-bundle

Symfony bundle for decorating default entity managers using a resettable decorator.

20113.5k](/packages/pixelfederation-doctrine-resettable-em-bundle)[leapt/core-bundle

Symfony LeaptCoreBundle

2529.1k4](/packages/leapt-core-bundle)

PHPackages © 2026

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