PHPackages                             sunnyflail/object-creator - 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. sunnyflail/object-creator

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

sunnyflail/object-creator
=========================

A simple class for building objects

1.1.0(4y ago)0561MITPHP

Since Jul 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/SunnyFlail/ObjectCreator)[ Packagist](https://packagist.org/packages/sunnyflail/object-creator)[ RSS](/packages/sunnyflail-object-creator/feed)WikiDiscussions main Synced 5d ago

READMEChangelogDependencies (2)Versions (5)Used By (1)

ObjectCreator
=============

[](#objectcreator)

A simple class providing object oriented interface over class invoking

Usage
=====

[](#usage)

First you need to import it by requiring composer autoloader AND then importing it in class that will use it

```
use SunnyFlail\ObjectCreator\ObjectCreator;
```

Creating object
---------------

[](#creating-object)

First you need a common object creator instance and then invoke `ObjectCreator::create` passing fully qualified class name as an argument (the namespaced CANNOT contain leading backslashes). This returns a mutable copy of ObjectCreator

```
$creator = new ObjectCreator();
$concreteCreator = $creator->create(Entity::class);
```

Setting properties
------------------

[](#setting-properties)

To set properties just invoke `ObjectCreator::withProperty` on initialised copy, passing name of the property as first value, and value as second. This returns the copy so you can chain it.

```
$concreteCreator->withProperty("propertyName", "value");
```

Getting object
--------------

[](#getting-object)

To get the object invoke `ObjectCreator::getObject` on initalised copy.

```
$object = $concreteCreator->getObject();
```

Extending
---------

[](#extending)

You can make your custom implementation of this by implementing interface `IObjectCreator`.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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

Total

4

Last Release

1747d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/50b47ac5307f9f924ae62916c792bbfcabe962da1a0eaf68230b2199d4a6283f?d=identicon)[SunnyFlail](/maintainers/SunnyFlail)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sunnyflail-object-creator/health.svg)

```
[![Health](https://phpackages.com/badges/sunnyflail-object-creator/health.svg)](https://phpackages.com/packages/sunnyflail-object-creator)
```

###  Alternatives

[symfony/thanks

Encourages sending ⭐ and 💵 to fellow PHP package maintainers (not limited to Symfony components)!

8.1k15.9M270](/packages/symfony-thanks)[ethanyehuda/magento2-cronjobmanager

A module for managing scheduled cron jobs from magento's admin panel

3632.5M1](/packages/ethanyehuda-magento2-cronjobmanager)

PHPackages © 2026

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