PHPackages                             intellex/generator - 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. intellex/generator

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

intellex/generator
==================

v1.0.1(6y ago)165MITPHP

Since Mar 9Pushed 6y ago1 watchersCompare

[ Source](https://github.com/IntellexApps/generator)[ Packagist](https://packagist.org/packages/intellex/generator)[ RSS](/packages/intellex-generator/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Dummy data generator for PHP
============================

[](#dummy-data-generator-for-php)

[Examples](#examples) and full [list of supported generators](#list-of-all-generators) below.

##### Image:

[](#image)

- Image URL generator from [Pixabay](https://pixabay.com) service (requires free API key).

##### Core:

[](#core)

- Boolean generator with **selectable chance** of true.
- Get a number in range, with or without **Gaussian distribution**.
- Random item from **weighted array**, allows you to manipulate chances.
- Random **date time** from a period, in **any format**.

##### Text and HTML:

[](#text-and-html)

- Generate **random strings** from custom or predefined pools of characters.
- **Lorem ipsum** text generator that supports: single word, **variable length** sentences, full paragraphs and complete articles.
- Full HTML generator for **decorated sentences**, paragraphs or full-out article **with images** (requires free Pixabay API key).

##### Bonus

[](#bonus)

- Generate a **GPS coordinate**, that is a maximum of meters away from any center you choose.
- A hardcoded generator that always returns the same results, just for good measure :)

Examples
--------

[](#examples)

**Tip:** After cloning, point browser to tests/index.php to see every possible result.

Image:

```
echo '';
```

GPS location within 3000 meters from the city centre of Amsterdam, Netherlands:

```
(new \Intellex\Generator\Plus\GpsLocationGen(52.3677607, 4.8785829, 3000));
```

Boolean with 50% chance of true:

```
(new BooleanGen())->gen();
```

Boolean with 80% chance of true:

```
(new BooleanGen(0.8))->gen();
```

Random number in range of 50 - 250:

```
(new NumericGen(50, 250))->gen();
```

Random number of mean 38 and mean 5 (Gaussian distribution):

```
(new GaussianDistributionGen(38, 4))->gen();
```

Random item from array:

```
(new ItemGen([ 1, 2, 3, 5, 7, 11 ]))->gen();
```

Random weighted item from array, where is 2 times more likely than B and 6 times more likely than C:

```
(new WeightedItemGen([ 'A' => 6, 'B' => 3, 'C' => 1 ]))->gen();
```

Full HTML article, with images:

```
(new HTMLArticleGen(true, $pixabayAPIKey))->gen();
```

List of all generators
----------------------

[](#list-of-all-generators)

Core:

- **BooleanGen** generates a boolean value, with the ability to give more chances to any of the results.
- **NumericGen** generates a random number in a specified range.
- **GaussianDistributionGen** uses a normal distribution to pick a random value in a range.
- **HardcodedGen** uses the value supplied in the constructor as a generated value, every time.
- **ItemGen** picks an item from the pool, where every item has the same change of being picked.
- **WeightedItemGen** picks a random item from the pool, with the ability to influence the change of picking for each item.

Bonus:

- **GpsLocationGen** generates a GPS location, within a supplied radius of a given central point. Output format is ,, with a maximum of 6 decimal digit precision.
- **PixabayImageURLGen** generates a URL to a random image on the Pixabay free image service, using their API.

Time:

- **TimestampGen** generates a random timestamp in a given range.
- **DateTimeGen** generates a random date in YYYY-MM-DD hh:mm:ss format.
- **DateGen** generates a random date in YYYY-MM-DD format.
- **TimeGen** generates a time in 24h format.

Strings and text:

- **StringGen** generates a random string.
- **WordGen** generates a single word, from a predefined "lorem ipsum" dictionary.
- **SentenceGenerator** generates a dummy sentence.
- **ParagraphGen** generates a random paragraph from random sentences.
- **ArticleGen** generates a random article form random paragraphs.

HTML:

- **HTMLSentenceGen** generates a random sentences with random HTML tags, such as b, strong, em, etc...
- **HTMLParagraphGen** generates a valid HTML paragraph.
- **HTMLSectionGen** generates an HTML header with random paragraphs.
- **HTMLArticleGen** generates a complete HTML article.

To do
-----

[](#to-do)

1. Testing of the results.
2. Better implementation of the WeightedItemGen.
3. Setters for all constructor parameters for all generators.
4. New generators.

Licence
-------

[](#licence)

MIT License

Copyright (c) 2019 Intellex

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Credits
-------

[](#credits)

Script has been written by the [Intellex](https://intellex.rs/en) team.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

2

Last Release

2200d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1008e18d1b96b552ce1b76dccf9d1d49d1658835cae153cd53c784a846121d2d?d=identicon)[intellexapps](/maintainers/intellexapps)

### Embed Badge

![Health badge](/badges/intellex-generator/health.svg)

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

PHPackages © 2026

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