PHPackages                             tibisoft/autotransformer - 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. tibisoft/autotransformer

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

tibisoft/autotransformer
========================

A little tool for transforming DTO's to entities and viseversa

0.7.0(1y ago)312MITPHP

Since Apr 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/WeTurkstra/autotransformer)[ Packagist](https://packagist.org/packages/tibisoft/autotransformer)[ RSS](/packages/tibisoft-autotransformer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (3)Versions (8)Used By (0)

Autotransformer
===============

[](#autotransformer)

Autotransformer is a little tool which does basic DTO to entity transforming and vise versa.

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

[](#installation)

```
composer require tibisoft/autotransformer

```

Usage
-----

[](#usage)

Without any extra configuration the transformer will loop over the properties of the target class/object and will try to find a equally named property in the source.

```
class User {
    public function __construct(
        private string $email,
        private string $plainPassword,
        private int $age,
    ) {

    }
}

class UserDTO {
    public function __construct(
        private string $email,
        private int $age,
    ) {

    }
}

$user = new User('example@email.com', 'someSecretPassword', 25);

$transformer = new \Tibisoft\AutoTransformer\AutoTransformer();
$userDTO = $transformer->transform($user, UserDTO::class);

//output:
object(UserDTO)#8 (2) {
  ["email":"UserDTO":private]=>
  string(17) "example@email.com"
  ["age":"UserDTO":private]=>
  int(25)
}
```

### Manipulate Transforming

[](#manipulate-transforming)

If the default transforming process is not enough you can add attributes to the target object/class and customise the output.

#### Synonyms

[](#synonyms)

```
class User {
    public function __construct(
        private string $email,
        private string $plainPassword,
        private int $age,
    ) {

    }
}

class UserDTO {
    public function __construct(
        private string $email,
        #[\Tibisoft\AutoTransformer\Attribute\Synonyms(['age'])]
        private int $yearsLive,
    ) {

    }
}

$user = new User('example@email.com', 'someSecretPassword', 25);

$transformer = new \Tibisoft\AutoTransformer\AutoTransformer();
$userDTO = $transformer->transform($user, UserDTO::class);

//output:
object(UserDTO)#8 (2) {
  ["email":"UserDTO":private]=>
  string(17) "example@email.com"
  ["yearsLive":"UserDTO":private]=>
  int(25)
}
```

#### Count

[](#count)

```
class User {
    public function __construct(
        private string $email,
        private array $comments,
    ) {

    }
}

class UserDTO {
    public function __construct(
        private string $email,
        #[\Tibisoft\AutoTransformer\Attribute\Count]
        private int $comments,
    ) {

    }
}

$user = new User('example@email.com', ['Comment #1', 'Comment #2', 'Comment #3', 'Comment #4']);

$transformer = new \Tibisoft\AutoTransformer\AutoTransformer();
$userDTO = $transformer->transform($user, UserDTO::class);

//output:
object(UserDTO)#8 (2) {
  ["email":"UserDTO":private]=>
  string(17) "example@email.com"
  ["comments":"UserDTO":private]=>
  int(4)
}
```

#### InArray

[](#inarray)

```
class InArrayClass
{
    public function __construct(
        public array $roles = [],
    ) {

    }
}

class InArrayDTO
{
    public function __construct(
        #[\Tibisoft\AutoTransformer\Attribute\InArray(property: 'roles', value: 'ROLE_TEAMLEADER')]
        public bool $isTeamleader,
    ) {

    }
}

$object = new InArrayClass(['ROLE_USER', 'ROLE_TEAMLEADER']);

$transformer = new \Tibisoft\AutoTransformer\AutoTransformer();
$inArrayDTO = $transformer->transform($object, InArrayDTO::class);

//output:
object(InArrayDTO)#8 (1) {
  ["isTeamleader"]=>
  bool(true)
}
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

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

Total

7

Last Release

709d ago

### Community

Maintainers

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

---

Top Contributors

[![WeTurkstra](https://avatars.githubusercontent.com/u/4559042?v=4)](https://github.com/WeTurkstra "WeTurkstra (25 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tibisoft-autotransformer/health.svg)

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

###  Alternatives

[morilog/jalali

This Package helps developers to easily work with Jalali (Shamsi or Iranian) dates in PHP applications, based on Jalali (Shamsi) DateTime class.

9201.2M45](/packages/morilog-jalali)[bruli/php-git-hooks

Git hooks for PHP projects.

675370.8k5](/packages/bruli-php-git-hooks)[nikolaposa/version

Value Object that represents a SemVer-compliant version number.

1406.4M16](/packages/nikolaposa-version)[prooph/common

Common classes used across prooph packages

852.2M27](/packages/prooph-common)[funeralzone/valueobjects

A PHP 7.1 value objects helper library.

66643.3k22](/packages/funeralzone-valueobjects)[tomasnorre/crawler

Crawler extension for TYPO3

58397.5k1](/packages/tomasnorre-crawler)

PHPackages © 2026

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