PHPackages                             kasperhansen/dot-array-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. kasperhansen/dot-array-mapper

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

kasperhansen/dot-array-mapper
=============================

Mapping array data using dot notation.

1.1.0(9mo ago)0254↓100%MITPHPPHP &gt;=8.3

Since Aug 7Pushed 9mo agoCompare

[ Source](https://github.com/kasperh90/dot-array-mapper)[ Packagist](https://packagist.org/packages/kasperhansen/dot-array-mapper)[ RSS](/packages/kasperhansen-dot-array-mapper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

DotArrayMapper
==============

[](#dotarraymapper)

Mapping array data using dot notation.

Installation
============

[](#installation)

```
composer require kasperhansen/dot-array-mapper
```

Usage
=====

[](#usage)

```
use Kasperhansen\DotArrayMapper;

$mapper = new DotArrayMapper();

// Set the data to be mapped
$mapper
    ->setData([
        'user' => [
            'name' => 'John Doe',
            'email' => 'john@doe.com',
            'address' => [
                'city' => 'New York',
            ],
        ],
    ])
    ->map([
        'name' => 'user.name',
        'email' => 'user.email',
        'city' => 'user.address.city',
    ])
    ->addFilter('name', fn($value) => strtoupper($value))
    ->addFilter('email', fn($value) => strtolower($value));

// Extract the mapped data
$mappedData = $mapper->extract();

// Output the mapped data
echo $mappedData['name']; // John Doe
echo $mappedData['email']; // john@doe.com
echo $mappedData['city']; // New York
```

License
=======

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

Contributing
============

[](#contributing)

Contributions are welcome!

###  Health Score

36

—

LowBetter than 81% of packages

Maintenance62

Regular maintenance activity

Popularity15

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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

Total

2

Last Release

272d ago

### Community

Maintainers

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

---

Tags

arraymapperdot notation

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/kasperhansen-dot-array-mapper/health.svg)

```
[![Health](https://phpackages.com/badges/kasperhansen-dot-array-mapper/health.svg)](https://phpackages.com/packages/kasperhansen-dot-array-mapper)
```

###  Alternatives

[doctrine/collections

PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.

6.0k411.1M1.2k](/packages/doctrine-collections)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k9.2M108](/packages/cuyz-valinor)[league/config

Define configuration arrays with strict schemas and access values with dot notation

564302.2M24](/packages/league-config)[phootwork/lang

Missing PHP language constructs

1224.8M8](/packages/phootwork-lang)

PHPackages © 2026

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