PHPackages                             m-adamski/phone-number-bundle - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. m-adamski/phone-number-bundle

Abandoned → [m-adamski/symfony-phone-number-bundle](/?search=m-adamski%2Fsymfony-phone-number-bundle)Symfony-bundle[Validation &amp; Sanitization](/categories/validation)

m-adamski/phone-number-bundle
=============================

Phone Number Bundle for Symfony

1.0.2(7y ago)013MITPHPPHP ^7.1

Since Feb 1Pushed 7y agoCompare

[ Source](https://github.com/m-adamski/symfony-phone-bundle)[ Packagist](https://packagist.org/packages/m-adamski/phone-number-bundle)[ RSS](/packages/m-adamski-phone-number-bundle/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (6)Versions (4)Used By (0)

PhoneNumber Bundle for Symfony 4
================================

[](#phonenumber-bundle-for-symfony-4)

**This bundle is deprecated!** A new repository has been created to maintain the convention of package names. I suggest using [this package](https://github.com/m-adamski/symfony-phone-number-bundle).

---

Custom PhoneNumber Bundle integrating [libphonenumber](https://github.com/giggsey/libphonenumber-for-php) library into Symfony 4 project. This bundle is inspired by [PhoneNumberBundle](https://github.com/misd-service-development/phone-number-bundle) but simplified and created for own projects - of course you can use it if you want.

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

[](#installation)

Use Composer to install this bundle into Symfony 4 project:

```
$ composer require m-adamski/symfony-phone-bundle

```

Configuration
-------------

[](#configuration)

Register new Doctrine Type in `config/packages/doctrine.yaml`

```
doctrine:
    dbal:
        types:
            phone_number: Adamski\Symfony\PhoneNumberBundle\Doctrine\DBAL\Types\PhoneNumberType

```

This Bundle provide type template for Bootstrap 4. Register it in `config/packages/twig.yaml`

```
twig:
    form_themes:
        - '@PhoneNumber/Form/phone_number_widget.html.twig'

```

You can also overwrite default Symfony Bootstrap 4 template by adding `- '@PhoneNumber/Form/bootstrap_4_layout.html.twig'` into `form_themes` parameter:

```
twig:
    form_themes:
        - '@PhoneNumber/Form/bootstrap_4_layout.html.twig'
        - '@PhoneNumber/Form/phone_number_widget.html.twig'

```

How to use it?
--------------

[](#how-to-use-it)

Bundle provide additional Doctrine Type and Form Type. First, edit entity to use PhoneNumber Type:

```
use Adamski\Symfony\PhoneNumberBundle\Model\PhoneNumber;
use Adamski\Symfony\PhoneNumberBundle\Validator\Constraints\PhoneNumber as AssertPhoneNumber;

/**
 * @var string
 * @AssertPhoneNumber
 * @ORM\Column(name="phone_number", type="phone_number", nullable=true)
 */
protected $phoneNumber;

```

Now it's time to provide changes in Form Type:

```
use Adamski\Symfony\PhoneNumberBundle\Form\PhoneNumberType;

public function buildForm(FormBuilderInterface $builder, array $options) {
        $builder->add("phoneNumber", PhoneNumberType::class, [
            "label"     => "Phone number",
            "preferred" => "PL",
            "required"  => false
        ]);
}

```

License
-------

[](#license)

MIT

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

2804d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/99031579203ae7aff3a32b3309374cb5703c35abc4737509bc6b228b433d9943?d=identicon)[m-adamski](/maintainers/m-adamski)

---

Top Contributors

[![m-adamski](https://avatars.githubusercontent.com/u/21038303?v=4)](https://github.com/m-adamski "m-adamski (17 commits)")

### Embed Badge

![Health badge](/badges/m-adamski-phone-number-bundle/health.svg)

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

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M378](/packages/easycorp-easyadmin-bundle)[kimai/kimai

Kimai - Time Tracking

4.8k8.7k1](/packages/kimai-kimai)[sylius/sylius

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

8.5k5.8M717](/packages/sylius-sylius)[chameleon-system/chameleon-base

The Chameleon System core.

1027.9k4](/packages/chameleon-system-chameleon-base)[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.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[sulu/sulu

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

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

PHPackages © 2026

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