PHPackages                             emreuyguc/structured-mapper - 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. emreuyguc/structured-mapper

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

emreuyguc/structured-mapper
===========================

Structured Mapper is a PHP library that helps you to map your objects, such as entities to DTOs or models to entities, easily.

v0.1.1-rc1(1y ago)3231MITPHPPHP &gt;=8.2

Since Jan 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/emreuyguc/php-structured-mapper)[ Packagist](https://packagist.org/packages/emreuyguc/structured-mapper)[ Docs](https://github.com/emreuyguc/php-structured-mapper)[ RSS](/packages/emreuyguc-structured-mapper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (15)Versions (4)Used By (1)

Euu Php Structured Mapper
=========================

[](#euu-php-structured-mapper)

[![PHP Version](https://camo.githubusercontent.com/4f0ff8d47b7c73441eb92a1f49af61c2d6521b14113c8fd85fac4416c863e7cc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d626c7565)](https://camo.githubusercontent.com/4f0ff8d47b7c73441eb92a1f49af61c2d6521b14113c8fd85fac4416c863e7cc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d626c7565)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)[![Author](https://camo.githubusercontent.com/85efbf2576652c697d47d0558e6ab14aa231e5f450142da0fa1bc9df956a1b02/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d656d726575796775632d6f72616e6765)](https://camo.githubusercontent.com/85efbf2576652c697d47d0558e6ab14aa231e5f450142da0fa1bc9df956a1b02/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d656d726575796775632d6f72616e6765)

Euu Structured Mapper is a simple and experimental data transformation library for PHP.

This project aims to simplify defining transformation rules using attributes and performing data type conversions. It also provides an extremely simple structure for ease of use.

Features
--------

[](#features)

- **Attribute-Based Mapping Definition:** Ability to define transformation rules using attributes.
- **mapFrom and mapTo Transformation Definitions:** Define transformation rules on either the source or target class.
- **Direct Property Definitions:** Define transformations directly on properties.
- **Context Passing and Usage:** Pass contextual information during mapping.
- **Value Transformers:** Perform type and data transformations using value transformer structures.
- **Important Transformers:** Predefined transformers for common use cases like Doctrine Entities, Enums, Array items, etc.
- **Structure Read and Storage Mechanism:** Extendable structure reader to read transformation definitions from different sources.
- **Custom Mapper Definitions:** Define custom transformation classes (see `MapperRegistry` and `MapperInterface`).
- **Array Item Transformations:** Transform array elements and process each element with a value transformer (see `ValueTransformer/ArrayItemTransform/ArrayItemTransformer.php`).
- **Sub-Object Transformations:** Define transformations for child objects (see `ValueTransformer/ObjectTransform/WithMapper.php`).

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

[](#installation)

Add Euu Structured Mapper to your project using Composer:

```
composer require emreuyguc/structured-mapper
```

Usage
-----

[](#usage)

For detailed examples, refer to the `example/ExampleFactory.php` file. Initialize the mapper according to your own usage scenarios.

Examples
--------

[](#examples)

- `example/MapFromExample.php`
- `example/MapToExample.php`
- `example/Dto/`
- `example/Entity/`

Limitations and Considerations
------------------------------

[](#limitations-and-considerations)

- **Object Constructor Issue:** Objects with constructors cannot be initialized during transformations. This area is open for improvement (Priority: High).
- **Reverse Transformation:** If `a -> b` transformations are defined, reverse (`b -> a`) is theoretically possible but not currently supported (Priority: Medium).
- **Type Conversion Mechanism:** There is no general mechanism for type conversions. Users must handle this manually or set the `type_enforcement` parameter to `false` for simple conversions (Priority: Low).
- **Property Naming:** Property names must be defined manually during mapping. An automatic name conversion mechanism can be added (Priority: Medium).
- **Cache Mechanism:** Currently, there is no caching mechanism. A suitable cache structure can be implemented (Priority: High).
- **Mapping Check:** A `canMap` method can be added for checking mappings (Priority: High).
- **Auto Sub-Type Mapping:** Automatically map child objects based on their types (Priority: Medium).
- **Custom Mapper Transformation Type Check:** Ensure that custom mapper definitions validate source and destination types. This check is currently missing (Priority: High).
- **Expression Usage in Entity Find Function:** Use expression language for custom parameters in entity transformations (Priority: Low).
- **Tests:** Write tests (Priority: High).

License
-------

[](#license)

This package is licensed under the [MIT License](LICENSE.md).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance50

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity38

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

Total

2

Last Release

392d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/998bfee719bb7fec056c6aecfded8ac88195951e15127a16b17c0512765592a3?d=identicon)[emreuyguc](/maintainers/emreuyguc)

---

Top Contributors

[![emreuyguc](https://avatars.githubusercontent.com/u/4369721?v=4)](https://github.com/emreuyguc "emreuyguc (6 commits)")

---

Tags

attributesdata-mappingdata-transformdtodto-entity-mapperdtosentitymappermappersobject-mappingphpphp-libraryphp-packagetransformerphpmappingmappertransformationdata mapperdtoobject mapperobject-to-objectdata-transformerphp-mapperentity-mapperdto-mapperemreuygucstructured-mapper

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/emreuyguc-structured-mapper/health.svg)

```
[![Health](https://phpackages.com/badges/emreuyguc-structured-mapper/health.svg)](https://phpackages.com/packages/emreuyguc-structured-mapper)
```

###  Alternatives

[jolicode/automapper

JoliCode AutoMapper

213439.4k7](/packages/jolicode-automapper)[symfony/ai-platform

PHP library for interacting with AI platform provider.

51927.7k134](/packages/symfony-ai-platform)[rekalogika/mapper

An object mapper for PHP and Symfony. Maps an object to another object. Primarily used for transforming an entity to a DTO and vice versa.

3847.7k1](/packages/rekalogika-mapper)[symfony/ai-agent

PHP library for building agentic applications.

30536.7k44](/packages/symfony-ai-agent)[nutgram/hydrator

Hydrator for PHP 8.0+

12265.2k6](/packages/nutgram-hydrator)[event4u/data-helpers

Framework-agnostic PHP library for data mapping, DTOs and utilities. Includes DataMapper, SimpleDto/LiteDto, DataAccessor/Mutator/Filter and helper classes (MathHelper, EnvHelper, etc.). Works with Laravel, Symfony/Doctrine or standalone PHP.

1421.5k](/packages/event4u-data-helpers)

PHPackages © 2026

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