Phony: The PHP Fake Data Generation Framework

website·Indexed 32 days ago

https://phony.land/

A PHP framework for generating massive amounts of realistic fake data in multiple locales, featuring providers for persons, addresses, currencies, artists, and specialized datasets like Cosmere and Ancient gods.

Tokens
3.3K
Snippets
36
Records
37
Agent score
57%

What's inside Phony

  1. Generate random ancient mythology names using Phony

    The ancient property of the Phony class provides access to several generators for retrieving random names from ancient mythology, categorized by their role (gods, primordials, titans, and heroes).
    use Phonyland\Phony;
    
    $🙃 = new Phony('en');
    
    $🙃->ancient->god;        // e.g., "Ares"
    $🙃->ancient->primordial;  // e.g., "Phanes"
    $🙃->ancient->titan;       // e.g., "Mnemosyne"
    $🙃->ancient->hero;       // e.g., "Icarus"
  2. Generate random Slack emojis by category using Phony

    The slack_emoji property of the Phony class allows you to retrieve a random Slack-formatted emoji string (e.g., :smile:) based on specific categories. Available categories include people, nature, food and drink, celebration, activity, travel and place, object and symbol, custom, and a general emoji category.
    use Phonyland//Phony;
    
    $phony = new Phony('en');
    
    // Get a random emoji from specific categories
    echo $phony->slack_emoji->people;           // e.g., :blush:
    echo $phony->slack_emoji->nature;           // e.g., :beetle:
    echo $phony->slack_emoji->food_and_drink;   // e.g., :sushi:
    echo $phony->slack_emoji->celebration;     // e.g., :heart:
    echo $phony->slack_emoji->activity;         // e.g., :tophat:
    echo $phony->slack_emoji->travel_and_place; // e.g., :hotel:
    echo $phony->slack_emoji->object_and_symbol; // e.g., :closed_book:
    echo $phony->slack_emoji->custom;           // e.g., :rube:
    echo $phony->slack_emoji->emoji;            // e.g., :crab:
  3. Generate random Cosmere universe data

    The cosmere property of the Phony class provides access to several properties that return random strings based on the Cosmere universe. These include elements like aon, shard worlds, shards, surges, knight radiants, metals, allomancers, feruchemists, heralds, and spren.
    use Phonyland\Phony;
    
    $🙃 = new Phony('en');
    
    $🙃->cosmere->aon;           // Random aon
    $🙃->cosmere->shard_world;    // Random shard world
    $🙃->cosmere->shard;          // Random shard
    $🙃->cosmere->surge;          // Random surge
    $🙃->cosmere->knight_radiant; // Random knight radiant
    $🙃->cosmere->metal;          // Random metal
    $🙃->cosmere->allomancer;     // Random allomancer
    $🙃->cosmere->feruchemist;    // Random feruchemist
    $🙃->cosmere->herald;         // Random herald
    $🙃->cosmere->spren;          // Random spren
  4. Generate random person names and components using Phonyland

    The person provider in Phonyland allows developers to generate various random identity components for a person. This is useful for seeding databases or creating mock user data.
    use Phonyland//Phony;
    
    $🙃 = new Phony('en');
    
    // Full name
    $🙃->person->name; // e.g., "Gayle Senger"
    
    // Full name including middle name
    $🙃->person->name_with_middle; // e.g., "Amalia Connelly Connelly"
    
    // Individual components
    $🙃->person->first_name; // e.g., "Letha"
    $🙃->person->middle_name; // e.g., "Marquardt"
    $🙃->person->last_name; // e.g., "Bode"
    $🙃->person->prefix; // e.g., "Dr."
    $🙃->person->suffix; // e.g., "Jr."
    
    // Gender-specific first names
    $🙃->person->male_first_name; // e.g., "Dewayne"
    $🙃->person->female_first_name; // e.g., "Princess"
  5. Generate random street and building addresses

    Phonyland provides several options for street-level data, including basic street names, full street addresses, and addresses that include secondary identifiers like apartment or suite numbers.
    use Phonyland\Phony;
    
    $🙃 = new Phony('en');
    
    echo $🙃->address->street_name; // "Daryl Cape"
    echo $🙃->address->street_address; // "99883 Sid Harbors"
    echo $🙃->address->secondary_address; // "Suite 257"
    echo $🙃->address->street_address_with_secondary_address; // "81113 Towne Mall Suite 923"
  6. Generate random city and state names

    Use $🙃->address->city to get a random city name, or $🙃->address->city_with_state to get a city paired with its corresponding state.
    use Phonyland\Phony;
    
    $🙃 = new Phony('en');
    
    echo $🙃->address->city; // "Port Dorian"
    echo $🙃->address->city_with_state; // "Lake Tuyethaven, Connecticut"
  7. Generate random postal and country codes

    Retrieve random postal codes (zip, postcode) and international country identifiers (ISO codes).
    use Phonyland\Phony;
    
    $🙃 = new Phony('en');
    
    echo $🙃->address->zip_code; // "48797"
    echo $🙃->address->country_code; // "PN"
    echo $🙃->address->country_code_long; // "VIR"
  8. Generate a random artist name using Phonyland

    Use the artist->name property on a Phony instance to retrieve a random name of an artist. The output is a string containing the artist's name (e.g., "Kandinsky", "Cassatt", or "Ansel Adams").
    use Phonyland
    Phony;
    
    $🙃 = new Phony('en');
    
    // Retrieves a random name of an artist
    $artistName = $🙃->artist->name;
  9. Retrieve a random currency name with Phonyland

    Use the coin->name property to retrieve the name of a random coin/currency from any country (e.g., "Dominican Peso", "Djibouti Franc").
    use Phonyland\Phony;
    
    $🙃 = new Phony('en');
    
    // Returns a random currency name
    $currency = $🙃->coin->name;
  10. Simulate a random coin flip with Phonyland

    Use the coin->flip property to retrieve a random face of a flipped coin. The possible return values are "Heads" or "Tails".
    use Phonyland\Phony;
    
    $🙃 = new Phony('en');
    
    // Returns "Heads" or "Tails"
    $result = $🙃->coin->flip;
  11. Retrieve a random surge

    Use the cosmere->surge property to retrieve a random surge from the Cosmere Universe. Examples of output include 'Abrasion', 'Transformation', and 'Division'.
    use Phonyland\Phony;
    
    $🙃 = new Phony('en');
    $result = $🙃->cosmere->surge;
  12. Generate a random currency name

    Use the currency->name property of the Phony instance to retrieve a random currency name (e.g., "Serbian Dinar", "Rupiah").
    use Phonyland//Phony;
    
    $🙃 = new Phony('en');
    $name = $🙃->currency->name;