PHPackages                             maximaster/atoa - 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. maximaster/atoa

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

maximaster/atoa
===============

Convert a value to another value using your own callables.

v1.0.0(1y ago)03MITPHPPHP &gt;=7.4

Since Sep 3Pushed 1y ago2 watchersCompare

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

READMEChangelogDependencies (1)Versions (2)Used By (0)

maximaster/atoa
===============

[](#maximasteratoa)

Convert a value to another value using your own callables.

```
composer require maximaster/atoa
```

Example
-------

[](#example)

```
namespace Maximaster\Atoa;

use Maximaster\Atoa\Contract\Atoa;
use Maximaster\Atoa\Converter;

class A { public function __construct(public string $value) {} }
class B { public function __construct(public string $value) {} }

// Implement converters for all needed cases.
// Make sure that callable has both input and return types described.
$converter = new Converter([
    static fn (A $a): B => new B($a->value),
    static fn (B $b): A => new A($b->value),
    static fn (string $c): int => intval($c),
]);

// Use Atoa interface instead of implementation in your services.
(static function (Atoa $atoa): void {
    // Ask converter to get desired type and pass any other type.
    // If the converter does know how to convert this object to desired type, it
    // would do it.
    $a = $converter->convertTo(A::class, new B('hello')); // A('hello')
    $b = $converter->convertTo(B::class, new A('hello')); // B('hello')
    $c = $converter->convertTo('int', '42'); // 42
})($converter);
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

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

Unknown

Total

1

Last Release

670d ago

### Community

Maintainers

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

---

Top Contributors

[![mlavrinenko](https://avatars.githubusercontent.com/u/15840214?v=4)](https://github.com/mlavrinenko "mlavrinenko (1 commits)")

### Embed Badge

![Health badge](/badges/maximaster-atoa/health.svg)

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

###  Alternatives

[gabrola/email-normalizer

A library that will normalize email addresses for cases when different email addresses all point towards a single email account

1986.7k](/packages/gabrola-email-normalizer)

PHPackages © 2026

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