PHPackages                             zipavlin/phony - 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. zipavlin/phony

ActiveLaravel-package

zipavlin/phony
==============

A helper class for parsing, normalizing and displaying Slovene phone numbers

1.2.0(3y ago)0632MITPHP

Since Nov 27Pushed 3y ago1 watchersCompare

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

READMEChangelog (3)DependenciesVersions (4)Used By (0)

Phony
=====

[](#phony)

A phone number parser tailored for Slovene number format.

Install
-------

[](#install)

```
$ composer require zipavlin/phony
```

Quick start
-----------

[](#quick-start)

```
use Zipavlin\Phony;
$phony = new Phony()

echo $phony->from('041 123-456')->toDisplay(); // +386 (0)41 123 456
echo $phony->from('041 123 456')->toFormat('00386 0{area}/{number:2}-{number:2}-{number}'); // 00386 041/12-34-56
echo $phony->from('01 1234-567')->toDisplay(); // +386 (0)1 12 34 567
```

Methods
-------

[](#methods)

method nameattributedescriptionfrom$inputCreate new instance from unformatted phone number stringtoParsedReturn phone number as parsed objecttoNormalReturn phone number as short normalized stringtoHrefReturn phone number as href linktoFullReturn phone number as full trimmed stringtoDisplayReturn phone number as fully formatted stringtoFormat$formatReturn phone number formatted with $format stringtoObject$formatReturn object with all phone number infotoRender$attributes, $formatRenders a attributeFormat string
-------------

[](#format-string)

`$format` attribute can be either `string` or `array [string, string]`, where first format string is used for mobile numbers and second one is used for stationary phone numbers.

### Format tokens

[](#format-tokens)

- `{area}` - area code **without** leading zero
- `{number}` - rest of phone number

Both tokens have an optional characters-count parameter: `{area:2}` and `{number:3}` respectively.

### Format example

[](#format-example)

Working with phone number *041 123456*`{area}/{number:5}-{number}` would return *41/12345-6*
`{area:1}-{area:1} {number}` would return *4-1 123456*
`0{area}/{number:3} {number:6}` would return *041/123 456*

###  Health Score

28

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

Total

3

Last Release

1284d ago

### Community

Maintainers

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

---

Top Contributors

[![zipavlin](https://avatars.githubusercontent.com/u/5628018?v=4)](https://github.com/zipavlin "zipavlin (3 commits)")

### Embed Badge

![Health badge](/badges/zipavlin-phony/health.svg)

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

PHPackages © 2026

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