PHPackages                             renshan/randbuilder - 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. renshan/randbuilder

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

renshan/randbuilder
===================

A data builder

v1.0.0(9y ago)025MITPHPPHP &gt;=7.0.0

Since Jan 18Pushed 9y ago1 watchersCompare

[ Source](https://github.com/renshan1990/randBuilder)[ Packagist](https://packagist.org/packages/renshan/randbuilder)[ RSS](/packages/renshan-randbuilder/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (2)Used By (0)

RandBuilder
===========

[](#randbuilder)

> A random data generator

Schema
======

[](#schema)

```
$schema = array(
    "object" => array(
        "name" => array(
            "type" => "string",
            "length" => 10,
            "prefix" => "builder_",
            "end" => "_redliub",
            "unique" => true
        ),
        "hash" => array(
            "type" => "string",
            "length" => array(10,20),
            "reducer" => "md5"
        ),
        "number" => array(
            "type" => "integer",
            "range" => array(10, 100),
            "unique" => true
        ),
        "price" => array(
            "type" => "float",
            "range" => array(100, 1000),
            "precision" => 2
        )
    ),

    "count" => 10  // How many object will be make
);
```

Ok, `$scheme` is a scheme used to generate the data you want, it's an array php, this array contains two items: `object` and `count`, `object` is the real **schema**, and `count` indicate how many you want.
Let's see the `object`, however of whatever, `object` is an array, items in `object` are fields to be generated, the most important thing is to define a field, items has a few attributes:

- type `type` is required, now RandBuilder support three types: string, integer and float.
- length `type` is required if `type` is string
- prefix `prefix` defaults to ''
- end `end` defaults to ''
- unique `unique` indicate the field is unique or not, defaults to `false`
- range `range` is not required for integer and float, it indicate the min and the max number to be generated
- precision `range` for `float`, it default to 0

Note: if `unique` is true, the actual quantity produced may be less than the specified quantity.

Example
=======

[](#example)

```
use RandBuilder\Builder;

$schema = array(
    "object" => array(
        "name" => array(
            "type" => "string",
            "length" => 10,
            "prefix" => "builder_",
            "end" => "_redliub",
            "unique" => true
        ),
        "hash" => array(
            "type" => "string",
            "length" => array(10,20),
            "reducer" => "md5"
        ),
        "number" => array(
            "type" => "integer",
            "range" => array(10, 100),
            "unique" => true
        ),
        "price" => array(
            "type" => "float",
            "range" => array(100, 1000),
            "precision" => 2
        )
    ),

    "count" => 10  // How many object will be make
);

$objects = Builder::build($schema);
``
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

3450d ago

### Community

Maintainers

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

---

Top Contributors

[![ohmountain](https://avatars.githubusercontent.com/u/16421374?v=4)](https://github.com/ohmountain "ohmountain (3 commits)")

### Embed Badge

![Health badge](/badges/renshan-randbuilder/health.svg)

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

###  Alternatives

[mediawiki/babel

Users can easily indicate their language proficiency on their user page

116.4k](/packages/mediawiki-babel)

PHPackages © 2026

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