Primordyx Framework Documentation

Lists
in package

Lists - Static data provider for testing and random generation

This utility class provides curated lists of data commonly needed for testing, random data generation, and mock content creation. All methods are static and return arrays of strings optimized for use with the RandomStuff generator.

Purpose

Lists serves as a centralized repository of test data, eliminating the need to hardcode arrays throughout the application. It provides consistent, well-curated datasets for:

  • Name generation (first names, last names by gender)
  • Geographic data (US states, timezones)
  • Lorem ipsum text generation
  • Common word lists for slug and identifier generation

Architecture

This is a pure utility class with no state - all methods are static and return predefined arrays. Data is typically hardcoded or loaded from internal resources to ensure consistency and availability.

Usage Patterns

Random Name Generation

$firstNames = Lists::maleFirstNames();
$lastName = Lists::lastNames()[array_rand(Lists::lastNames())];

State Data Access

$states = Lists::states(); // Returns ['AL' => 'Alabama', ...]

Lorem Ipsum Generation

$words = Lists::loremIpsum();
$sentence = implode(' ', array_slice($words, 0, 10));

Integration

Lists is primarily used by RandomStuff for generating test data, but can be used directly when deterministic access to the data is needed.

Tags
see
RandomStuff

Primary consumer of Lists data

see
State

For more complex state data operations

Table of Contents

Methods

bigFiveCharWords()  : array<string|int, string>
Get array of common five-character English words
femaleFirstNames()  : array<string|int, string>
Get array of common female first names
lastNames()  : array<string|int, string>
Get array of common last names
loremIpsum()  : array<string|int, string>
Get array of Lorem Ipsum words
maleFirstNames()  : array<string|int, string>
Get array of common male first names
phpTimeZones()  : array<string|int, string>
Get array of PHP timezone identifiers
states()  : array<string, string>
Get associative array of US state abbreviations and names
unisexFirstNames()  : array<string|int, string>
Get array of gender-neutral first names

Methods

bigFiveCharWords()

Get array of common five-character English words

public static bigFiveCharWords() : array<string|int, string>

Returns a curated list of exactly five-character English words. This specific length is useful for generating consistent identifiers, codes, or memorable combinations. Words are typically lowercase and exclude profanity.

Tags
example
$words = Lists::bigFiveCharWords();
$code = $words[array_rand($words)] . '-' . $words[array_rand($words)];
since
1.0.0
see
RandomStuff::myThreeWords()

Uses this list for generating identifiers

Return values
array<string|int, string>

Indexed array of five-character words

femaleFirstNames()

Get array of common female first names

public static femaleFirstNames() : array<string|int, string>

Returns a curated list of common English female first names suitable for generating test data. The list focuses on traditional and widely-used names to ensure realistic test scenarios.

Tags
example
$names = Lists::femaleFirstNames();
$random = $names[array_rand($names)];
since
1.0.0
see
Lists::maleFirstNames()

For male names

see
Lists::unisexFirstNames()

For gender-neutral names

Return values
array<string|int, string>

Indexed array of female first names

lastNames()

Get array of common last names

public static lastNames() : array<string|int, string>

Returns a comprehensive list of common surnames/family names primarily from English-speaking countries. The list is designed to provide realistic variety for test data generation while maintaining cultural sensitivity.

Tags
example
$surnames = Lists::lastNames();
$random = $surnames[array_rand($surnames)];
since
1.0.0
Return values
array<string|int, string>

Indexed array of last names

loremIpsum()

Get array of Lorem Ipsum words

public static loremIpsum() : array<string|int, string>

Returns an array of individual Latin words commonly used in Lorem Ipsum placeholder text. Words are lowercase and can be combined to form sentences or paragraphs of dummy text for testing layouts and content areas.

Tags
example
$words = Lists::loremIpsum();
$sentence = ucfirst(implode(' ', array_slice($words, 0, 8))) . '.';
since
1.0.0
Return values
array<string|int, string>

Indexed array of Lorem Ipsum words

maleFirstNames()

Get array of common male first names

public static maleFirstNames() : array<string|int, string>

Returns a curated list of common English male first names suitable for generating test data. The list focuses on traditional and widely-used names to ensure realistic test scenarios.

Tags
example
$names = Lists::maleFirstNames();
$random = $names[array_rand($names)];
since
1.0.0
see
Lists::femaleFirstNames()

For female names

see
Lists::unisexFirstNames()

For gender-neutral names

Return values
array<string|int, string>

Indexed array of male first names

phpTimeZones()

Get array of PHP timezone identifiers

public static phpTimeZones() : array<string|int, string>

Returns a list of valid PHP timezone identifiers that can be used with date/time functions. This typically includes major timezones from around the world in the format "Continent/City" (e.g., "America/New_York").

Tags
example
$timezones = Lists::phpTimeZones();
date_default_timezone_set($timezones[0]);
since
1.0.0
see
DateTimeZone::listIdentifiers()

PHP's built-in timezone list

Return values
array<string|int, string>

Indexed array of timezone identifiers

states()

Get associative array of US state abbreviations and names

public static states() : array<string, string>

Returns a complete list of US states as a key-value array where keys are two-letter state abbreviations and values are full state names. This list includes all 50 states but excludes territories and districts.

Tags
example
$states = Lists::states();
echo $states['TX']; // "Texas"
echo $states['CA']; // "California"
since
1.0.0
Return values
array<string, string>

Associative array of state codes to names

unisexFirstNames()

Get array of gender-neutral first names

public static unisexFirstNames() : array<string|int, string>

Returns a curated list of first names that are commonly used for any gender. Useful for generating inclusive test data or when gender specification is not required or desired.

Tags
example
$names = Lists::unisexFirstNames();
$random = $names[array_rand($names)];
since
1.0.0
see
Lists::maleFirstNames()

For specifically male names

see
Lists::femaleFirstNames()

For specifically female names

Return values
array<string|int, string>

Indexed array of unisex first names


        
On this page

Search results