PHPackages                             nepada/phone-number-doctrine - 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. [Database &amp; ORM](/categories/database)
4. /
5. nepada/phone-number-doctrine

ActiveLibrary[Database &amp; ORM](/categories/database)

nepada/phone-number-doctrine
============================

Phone number type for Doctrine.

v2.3.3(7mo ago)538.7k↓38.4%1BSD-3-ClausePHPPHP &gt;=8.1.0 &lt;8.6CI passing

Since Jun 10Pushed 3mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (15)Versions (20)Used By (0)

Phone number Doctrine type
==========================

[](#phone-number-doctrine-type)

[![Build Status](https://github.com/nepada/phone-number-doctrine/workflows/CI/badge.svg)](https://github.com/nepada/phone-number-doctrine/actions?query=workflow%3ACI+branch%3Amaster)[![Coverage Status](https://camo.githubusercontent.com/69720e481ee48c986c31e386c477e10ff815a9e86f3551b67abe8785704c343f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6e65706164612f70686f6e652d6e756d6265722d646f637472696e652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/nepada/phone-number-doctrine?branch=master)[![Downloads this Month](https://camo.githubusercontent.com/6d08143cba0438605babe563393b4c080604cbb95aa324b62aae98140fb4f7ac/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6e65706164612f70686f6e652d6e756d6265722d646f637472696e652e737667)](https://packagist.org/packages/nepada/phone-number-doctrine)[![Latest stable](https://camo.githubusercontent.com/c1f21c9488d4652389c94c86166ee0fce4b781a6e204ac4ec20f790eaf09fe6e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e65706164612f70686f6e652d6e756d6265722d646f637472696e652e737667)](https://packagist.org/packages/nepada/phone-number-doctrine)

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

[](#installation)

Via Composer:

```
$ composer require nepada/phone-number-doctrine
```

Register the type in your bootstrap:

```
\Doctrine\DBAL\Types\Type::addType(
    \Brick\PhoneNumber\PhoneNumber::class,
    \Nepada\PhoneNumberDoctrine\PhoneNumberType::class
);
```

In Nette with [nettrine/dbal](https://github.com/nettrine/dbal) integration, you can register the types in your configuration:

```
dbal:
    connection:
        types:
            Brick\PhoneNumber\PhoneNumber: Nepada\PhoneNumberDoctrine\PhoneNumberType
```

Usage
-----

[](#usage)

`PhoneNumberType` maps database value to phone number value object (see [brick/phonenumber](https://github.com/brick/phonenumber) for further details) and back. The phone number is stored using E164 format, i.e. a '+' sign followed by a series of digits comprising the country code and national number.

Example usage in the entity:

```
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Brick\PhoneNumber\PhoneNumber;

#[Entity]
class Contact
{

    #[Column(type: PhoneNumber::class, nullable: false)]
    private PhoneNumber $phoneNumber;

    public function getPhoneNumber(): PhoneNumber
    {
        return $this->phoneNumber;
    }

}
```

Example usage in query builder:

```
$result = $repository->createQueryBuilder('foo')
    ->select('foo')
    ->where('foo.phoneNumber = :phoneNumber')
     // the parameter value is automatically normalized to +420123456789
    ->setParameter('phoneNumber', '+420 123 456 789', \Brick\PhoneNumber\PhoneNumber::class)
    ->getQuery()
    ->getResult();
```

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance73

Regular maintenance activity

Popularity34

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity89

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 56.7% 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 ~178 days

Recently: every ~169 days

Total

16

Last Release

219d ago

Major Versions

v1.2.1 → v2.0.02020-06-06

PHP version history (7 changes)v1.0.0PHP &gt;=7.1.0

v1.1.0PHP &gt;=7.2.0

v1.2.0PHP &gt;=7.4.0

v2.1.1PHP &gt;=7.4.0 &lt;8.3

v2.2.0PHP &gt;=8.1.0 &lt;8.4

v2.3.1PHP &gt;=8.1.0 &lt;8.5

v2.3.3PHP &gt;=8.1.0 &lt;8.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b4780fe328102c4572737db639653c29d3081d1d3e051467f00d7f09a776399?d=identicon)[xificurk](/maintainers/xificurk)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (153 commits)")[![xificurk](https://avatars.githubusercontent.com/u/117465?v=4)](https://github.com/xificurk "xificurk (115 commits)")[![evertharmeling](https://avatars.githubusercontent.com/u/308513?v=4)](https://github.com/evertharmeling "evertharmeling (2 commits)")

---

Tags

Value Objectdoctrinephone-number

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nepada-phone-number-doctrine/health.svg)

```
[![Health](https://phpackages.com/badges/nepada-phone-number-doctrine/health.svg)](https://phpackages.com/packages/nepada-phone-number-doctrine)
```

###  Alternatives

[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58723.9M36](/packages/scienta-doctrine-json-functions)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[martin-georgiev/postgresql-for-doctrine

Extends Doctrine with native PostgreSQL support for arrays, JSONB, ranges, PostGIS geometries, text search, ltree, uuid, and 100+ PostgreSQL-specific functions.

4485.3M4](/packages/martin-georgiev-postgresql-for-doctrine)[damienharper/auditor-bundle

Integrate auditor library in your Symfony projects.

4542.8M](/packages/damienharper-auditor-bundle)[flow-php/doctrine-dbal-bulk

Bulk inserts and updates for Doctrine DBAL

14295.2k1](/packages/flow-php-doctrine-dbal-bulk)[yokai/doctrine-value-object

Value Objects for Doctrine ORM simplified

1330.4k1](/packages/yokai-doctrine-value-object)

PHPackages © 2026

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