PHPackages                             sf4/populator - 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. sf4/populator

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

sf4/populator
=============

Populator is a simple Array-To-Object library which transforms arrays into a given object

v1.1.8(7y ago)0353[1 issues](https://github.com/Sf4/Populator/issues)MITPHPPHP ~7.1

Since Jan 16Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Sf4/Populator)[ Packagist](https://packagist.org/packages/sf4/populator)[ Docs](https://github.com/sf4/populator)[ RSS](/packages/sf4-populator/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (10)Dependencies (3)Versions (12)Used By (0)

Populator
=========

[](#populator)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4b2b9b7eda455c57d4b755363e990b55cc5b5814dbdc6101d9fc478ce81cfd7d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7366342f706f70756c61746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sf4/populator)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/427e64374a4f71f14230b036753ef3b04c6b17dbb6815b4597ce4aca4d4e04ef/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7366342f706f70756c61746f722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/sf4/populator)[![Coverage Status](https://camo.githubusercontent.com/b67eff4cb18b10e80c94eb4e707767f65dc527cf6f2d274ed7cec961efeada57/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f7366342f706f70756c61746f722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/sf4/populator/code-structure)[![Quality Score](https://camo.githubusercontent.com/b531911ba5a69f5d932c91532038638e741838d0fb8b4cd4351cf6ae24b4baf7/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7366342f706f70756c61746f722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/sf4/populator)[![Total Downloads](https://camo.githubusercontent.com/d3fc01ce5f45efda2a8ff6e12a887bd1a993d2ea97bae2bf09679bd8931c8db2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7366342f706f70756c61746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sf4/populator)

Populator is a simple Array-To-Object library which transforms arrays into a given object

Structure
---------

[](#structure)

If any of the following are applicable to your project, then the directory structure should follow industry best practices by being named the following.

```
bin/
config/
src/
tests/
vendor/

```

Install
-------

[](#install)

Via Composer

```
$ composer require sf4/populator
```

Usage
-----

[](#usage)

```
namespace Acme\Model;

class Foo
{
    protected $bar;
    public $public;
    public $publicWithSetter;

    public function setBar($bar)
    {
        $this->bar = $bar;
    }

    public function getBar()
    {
        return $this->bar;
    }

    public function setPublicWithSetter($var)
    {
        $this->publicWithSetter = $var;
    }
}

$data = array(
    'bar' => 'Foobaz!',
    'public' => 'Public!'
    'publicWithSetter' => 'BySetter'
);

/**
 * You can give either classname or an instance
 */
$foo = new Acme\Model\Foo();
$foo = 'Acme\Model\Foo';

$populator = new Sf4\Populator();
$newFoo = $populator->populate($data, $foo);

echo $newFoo->getBar();         // Foobaz!
echo $newFoo->public;           // Public!
echo $newFoo->publicWithSetter; // BySetter
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Siim Liimand](https://github.com/siimliimand)
- [Skeleton](https://github.com/thephpleague/skeleton)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Total

10

Last Release

2657d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2471d28ff80a5a5742aafa5fd075002dba1de6e0bd668115b49158ec39f4830b?d=identicon)[siimliimand](/maintainers/siimliimand)

---

Top Contributors

[![siimliimand](https://avatars.githubusercontent.com/u/7560943?v=4)](https://github.com/siimliimand "siimliimand (11 commits)")

---

Tags

sf4populator

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/sf4-populator/health.svg)

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

###  Alternatives

[friendsofsymfony/comment-bundle

This Bundle provides threaded comment functionality for Symfony applications

460751.2k5](/packages/friendsofsymfony-comment-bundle)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

52664.9k12](/packages/solspace-craft-freeform)[koriym/attributes

An annotation/attribute reader

433.4M12](/packages/koriym-attributes)[hostnet/entity-tracker-component

Provides an event when a Tracked entity changes

16158.1k4](/packages/hostnet-entity-tracker-component)[gomachan46/state-machine

simple state machine with annotations for PHP, inspired by AASM known as a Ruby state machine.

1893.9k](/packages/gomachan46-state-machine)[hostnet/accessor-generator-plugin-lib

Generate get, set, add, remove methods on the fly.

10118.9k](/packages/hostnet-accessor-generator-plugin-lib)

PHPackages © 2026

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