PHPackages                             koala-framework/sync-base - 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. koala-framework/sync-base

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

koala-framework/sync-base
=========================

27.6k1[1 PRs](https://github.com/koala-framework/sync-base/pulls)PHP

Since Sep 18Pushed 3y ago2 watchersCompare

[ Source](https://github.com/koala-framework/sync-base)[ Packagist](https://packagist.org/packages/koala-framework/sync-base)[ RSS](/packages/koala-framework-sync-base/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (8)Used By (0)

sync-base
=========

[](#sync-base)

Normalizers
-----------

[](#normalizers)

#### ConfigurableNormalizer

[](#configurablenormalizer)

A configurable normalizer can be used to normalize the entire structure of the raw data. A normalization config has to be passed to its constructor.

- Each config key represents the name of the normalized field (output)
- Each config value represents the name of a key in the raw data object (input). Nested values can be retrieved by separating multiple nested keys with a period (.)
- Values of the raw data object can be prioritized by grouping them in an array. The first value will have the highest priority. If that value does not exist in the raw data object, the next value will be used, and so on.

```
$normalizationConfig = array(
    // one to one mapping:
    'normalizedFieldName1' => 'rawDataFieldName',
    // nested mapping:
    'normalizedFieldName2' => 'nested.rawDataFieldName',
    // prioritized mappding:
    'normalizedFieldName2' => 'array(
        'rawDataFieldName',
        'alternativeRawDataFieldName',
        'nested.alternative.rawDataFieldName'
    )
);

```

A configurable normalizer can include configurations for other normalizers. Such a can contain three parameters:

- **field**: the key in the raw data object (can also be nested or omitted, if `StaticValue`-Normalizer)
- **class**: the class of the normalizer
- **args**: arguments that will be passed to the normalizer's constructor

#### MapRawValue

[](#maprawvalue)

This normalizer maps one or multiple values from the raw data object to a specified normalized value. Here's an example of how a `MapSyncedValue`-Normalizer can be passed to the config of the `ConfigurableNormalizer`:

```
$normalizationConfig = array(
    'normalizedFieldName' => array(
        'class' => 'Kwf\SyncBaseBundle\Services\Sync\Normalizer\MapRawValue',
        'field' => 'nested.rawDataFieldName',
        'args' => array(array(
            'rawValue' => 'normalizedValue',
            'Allrad' => 'A',
            'Allradantrieb' => 'A',
            'Allrad permanent' => 'A',
            'Allrad zuschaltbar' => 'A',
            'Allrad allgemein' => 'A',
            'Front' => 'F',
            'Frontantrieb' => 'F',
            'Vorderrad' => 'F',
            'Vorderradantrieb' => 'F',
            'Hinterrad' => 'H',
            'Hinterradantrieb' => 'H',
            'Heckantrieb' => 'H',
            'Heck' => 'H'
        ))
    )
);

```

#### StaticValue

[](#staticvalue)

This normalizer sets a static value that doesn't come from the raw data object, but should be included in the normalized data object.

```
$normalizationConfig = array(
   'normalizedFieldName' => array(
       'class' => 'Kwf\SyncBaseBundle\Services\Sync\Normalizer\StaticValue',
       'args' => array(
           'staticValue'
       )
   )
);

```

#### RawValueJsonAggregator

[](#rawvaluejsonaggregator)

This normalizer converts multiple values from the raw data object into a JSON string that will be assigned to a single normalized field. The **field** contains an array of raw-data-field-names, while **args** contains a mapping-array with its keys being the keys in the normalized JSON-Object, and the values being the same raw-data-fields that have been passed to the **field**.

```
$normalizationConfig = array(
   'normalizedFieldName' => array(
       'class' => 'Kwf\SyncBaseBundle\Services\Sync\Normalizer\RawValueJsonAggregator',
       'field' => array(
            'nested.rawDataFieldName',
            'rawDataFieldName',
            'another.nested.rawDataFieldName'
        )
       'args' => array(array(
           'keyForRawDataFieldName' => 'nested.rawDataFieldName',
           'anotherKeyInTheJsonObject' => 'rawDataFieldName',
           'yetAnotherKey' => 'another.nested.rawDataFieldName'
       ))
   )
);

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 57.1% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e5c63daf78f9ac54157d4bec473b8b1f6ecd1abd0a90c3ec96831224f149a22?d=identicon)[Ben-Ho](/maintainers/Ben-Ho)

---

Top Contributors

[![lllHuber](https://avatars.githubusercontent.com/u/12497541?v=4)](https://github.com/lllHuber "lllHuber (40 commits)")[![Ben-Ho](https://avatars.githubusercontent.com/u/1324250?v=4)](https://github.com/Ben-Ho "Ben-Ho (23 commits)")[![qrakhen](https://avatars.githubusercontent.com/u/25365980?v=4)](https://github.com/qrakhen "qrakhen (7 commits)")

### Embed Badge

![Health badge](/badges/koala-framework-sync-base/health.svg)

```
[![Health](https://phpackages.com/badges/koala-framework-sync-base/health.svg)](https://phpackages.com/packages/koala-framework-sync-base)
```

PHPackages © 2026

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