Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 17, 2024 via composer

nelmio/alice 3.13.5

Expressive fixtures generator
Package summary
Share
0
issues
2
licenses
13
MIT
4
BSD-3-Clause
Package created
29 Oct 2012
Version published
2 Apr 2024
Maintainers
2
Total deps
17
Direct deps
5
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
13 Packages, Including:
fakerphp/faker@v1.23.1
myclabs/deep-copy@1.11.1
nelmio/alice@3.13.5
psr/container@2.0.2
symfony/deprecation-contracts@v3.5.0
symfony/polyfill-ctype@v1.29.0
symfony/polyfill-intl-grapheme@v1.29.0
symfony/polyfill-intl-normalizer@v1.29.0
symfony/polyfill-mbstring@v1.29.0
symfony/property-access@v7.0.7
symfony/property-info@v7.0.7
symfony/string@v7.0.7
symfony/yaml@v7.0.7

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
4 Packages, Including:
sebastian/comparator@6.0.0
sebastian/diff@6.0.1
sebastian/exporter@6.0.1
sebastian/recursion-context@6.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

5
All Dependencies CSV
β“˜ This is a list of nelmio/alice 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
fakerphp/fakerv1.23.13.36 MBMIT
prod
myclabs/deep-copy1.11.122.96 kBMIT
prod
sebastian/comparator6.0.019.57 kBBSD-3-Clause
prod
symfony/property-accessv7.0.7-MIT
prod
symfony/yamlv7.0.7-MIT
prod

Visualizations

Frequently Asked Questions

What does nelmio/alice do?

Nelmio/Alice is a comprehensive library built to manage the generation of fake data, also known as fixtures, for PHP projects. It leverages the capabilities of the FakerPHP/Faker library, providing an expressive and easy-to-use interface to create large volumes of complex data for use in project development and testing. The library is capable of generating data that satisfies a range of constraints and is organized in a way that allows everyone on your team to easily tweak the generated fixtures as needed.

How do you use nelmio/alice?

To use Nelmio/Alice, you first need to install it via Composer as nelmio/alice by running the following command in your terminal:

composer require --dev nelmio/alice

To begin generating fixtures with Nelmio/Alice, simply create a file specifying the entity definitions and desired data constraints. This can be expressed in YAML syntax, as shown:

Nelmio\Entity\User:
    user{1..10}:
        username: '<username()>'
        fullname: '<firstName()> <lastName()>'
        birthDate: '<date_create()>'
        email: '<email()>'
        favoriteNumber: '50%? <numberBetween(1, 200)>'

Once you've specified your fixture data, you can load it using PHP, as the following example describes:

$loader = new Nelmio\Alice\Loader\NativeLoader();
$objectSet = $loader->loadFile(__DIR__.'/fixtures.yml');

You can also load fixtures directly from an array:

$loader = new Nelmio\Alice\Loader\NativeLoader();
$objectSet = $loader->loadData([
    \Nelmio\Entity\User::class => [
        'user{1..10}' => [
            'username' => '<username()>',
            'fullname' => '<firstName()> <lastName()>',
            'birthDate' => '<date_create()>',
            'email' => '<email()>',
            'favoriteNumber' => '50%? <numberBetween(1, 200)>',
        ],
    ],
]);

Where are the nelmio/alice docs?

The Nelmio/Alice documentation is available and up-to-date on GitHub, and it contains an exhaustive reference for using the library. You can find in-depth explanations, added examples, and covering other related topics that can provide a more profound understanding. For the more advanced topics, see "Advanced Guide" and "Customize Data Generation". For contributing to the project, check the "Contribute" section. Documentation for previous versions is also accessible if required. Find the complete documentation on GitHub at the following link.