PHPackages                             ekiwok/quick-fixtures - 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. ekiwok/quick-fixtures

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

ekiwok/quick-fixtures
=====================

Generate complex fixtures based on @var annotations.

0.9.1(9y ago)046MITPHPPHP &gt;=5.6

Since Jan 10Pushed 7y agoCompare

[ Source](https://github.com/ekiwok/QuickFixtures)[ Packagist](https://packagist.org/packages/ekiwok/quick-fixtures)[ RSS](/packages/ekiwok-quick-fixtures/feed)WikiDiscussions master Synced 3w ago

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

QuickFixtures [![Build Status](https://camo.githubusercontent.com/a94cabc5719eeb543bceba6f753563c448e950c43185fee3915b869e5574cbb4/68747470733a2f2f7472617669732d63692e6f72672f656b69776f6b2f517569636b46697874757265732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ekiwok/QuickFixtures)
=========================================================================================================================================================================================================================================================================================================

[](#quickfixtures-)

- Did you ever add unnecessary setter because you didn't want to use reflections in fixtures?
- Did you give up on using value objects because writing fixtures this way was messy?
- Did you create trait to help with \\DateTime creation in fixtures?

If anything above applies to you you may find this helpful.

This small library may quickly generate fixtures for you based on dockblock annotations that probably already are present in your code.

Provided generator accepts associative arrays so you may keep your fixtures data in file of your choice. It might be yaml, xml, csv, etc...

Fe. prepare yaml file like this:

```
    "Jake Weary":
        uuid: "123e4567-e89b-12d3-a456-426655440000"
        name: "Jake Weary"
        email: "jake.weary@example.com"
        # Notice that for single property objects it's ok to skip property name
        credit: 100
```

And just use this data to generate fixture:

```
    $jakeWearyData = /* fetch "Jake Weary" entry from yml */

    $jakeWeary = $generator->generate(Customer::class, $jakeWearyData);
```

Instead of writing:

```
    $jakeWeary = new Customer(
        '123e4567-e89b-12d3-a456-426655440000',
        'Jake Weary',
        'jake.weary@example.com',
        new Credit(100),
    );
```

or:

```
    $jakeWeary = (new Customer())
        ->setUUID('123e4567-e89b-12d3-a456-426655440000')
        ->setName('Jake Weary')
        ->setEmail'jake.weary@example.com')
        ->setCredit(new Credit(100))
    ;
```

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

[](#installation)

Install with composer: `composer require ekiwok/quick-fixtures`

Extending
---------

[](#extending)

It's easily extendable by adding your own processors.

```
    $generator->addProcessor(new class implements \Ekiwok\QuickFixtures\Processor\PrioritisedProcessorInterface{

        public function getPriority()
        {
            return 1025;
        }

        public function process(\Ekiwok\QuickFixtures\ContextInterface $context, $payload, \Ekiwok\QuickFixtures\GeneratorInterface $generator)
        {
            return new \DateTime($payload);
        }

        public function applies(\Ekiwok\QuickFixtures\ContextInterface $context, $payload)
        {
            $type = $context->getType();

            // in real life we would also check payload to be sure it
            // also makes sense

            return $type->hasAnyClass()
                && $type->hasClass(\DateTime::class);
        }
    });
```

Processor with this priority will be run before built in processors and will set all properties these are marked as `@var \DateTime`.

Documentation
-------------

[](#documentation)

- [Getting Started](/doc/Getting_Started.md)
- [Processors](/doc/Processors.md)

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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

2

Last Release

3451d ago

### Community

Maintainers

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

---

Top Contributors

[![ekiwok](https://avatars.githubusercontent.com/u/5066380?v=4)](https://github.com/ekiwok "ekiwok (38 commits)")

### Embed Badge

![Health badge](/badges/ekiwok-quick-fixtures/health.svg)

```
[![Health](https://phpackages.com/badges/ekiwok-quick-fixtures/health.svg)](https://phpackages.com/packages/ekiwok-quick-fixtures)
```

###  Alternatives

[voku/portable-utf8

Portable UTF-8 library - performance optimized (unicode) string functions for php.

51923.1M48](/packages/voku-portable-utf8)

PHPackages © 2026

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