Download the PHP package nelmio/alice without Composer
On this page you can find all versions of the php package nelmio/alice. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package alice
Alice - Expressive fixtures generator
Relying on FakerPHP/Faker, Alice allows you to create a ton of fixtures/fake data for use while developing or testing your project. It gives you a few essential tools to make it very easy to generate complex data with constraints in a readable and easy to edit way, so that everyone on your team can tweak the fixtures if needed.
Warning: this doc is for alice 3.0. If you want to check the documentation for 2.x, follow this link.
2.x is in maintenance mode: PRs are accepted, but no active development is done on it by the maintainers any longer.
Table of Contents
- Installation
- Example
- Getting Started
- Basic Usage
- Framework integration
- Symfony
- Complete Reference
- Creating Fixtures
- YAML
- PHP
- JSON
- Fixture Ranges
- Fixture Lists
- Fixture Reference
- Calling Methods
- Method arguments with flags
- Method arguments with parameters
- Specifying Constructor Arguments
- Using a factory / a named constructor
- Optional Data
- Handling Unique Constraints
- Creating Fixtures
- Handling Relations
- References
- Multiple References
- Self reference
- Passing references to providers
- Keep Your Fixtures Dry
- Fixture Inheritance
- Including files
- Variables
- Parameters
- Static parameters
- Dynamic parameters
- Composite parameters
- Usage with functions (constructor included)
- Inject external parameters
- Customize Data Generation
- Faker Data
- Localized Fake Data
- Random data
- Default Providers
- Identity
- Current
- Cast
- Custom Faker Data Providers
- Faker Data
- Advanced Guide
- Performance
- Expression Language (DSL)
- Parameters
- Functions
- Identity
- Arrays
- Optional
- References
- Property Reference
- Extending Alice
- Custom Flag
- Custom Instantiation
- Custom Accessor
- Third-party libraries
- Symfony
- Nette
- Zend Framework 2
- Framework Agnostic
- Contribute
- Differences between 2.x and 3.x
- Architecture
- FixtureBuilder
- Generator
- Expression Language
- Contributing
- Testing
- Profiling
- Backward Compatibility Promise (BCP)
- Upgrade
- Breaking changes between Alice 2.x and 3.0
Installation
This is installable via Composer as nelmio/alice:
composer require --dev nelmio/alice
Example
Here is a complete example of entity declaration:
You can then load them easily with:
Or load an array right away:
For more information, refer to the documentation.
Third-party libraries
Framework Agnostic
Symfony
Nette
WordPress
Zend Framework 2:
Contribute
Check the contribution guide.
Backward Compatibility Promise (BCP)
The policy is for the major part following the same as Symfony's one with a few changes or highlights:
- Code marked with
@private
or@internal
are excluded from the BCP Nelmio\Alice\Loader\NativeLoader
is excluded from the BCP: as it is the no DIC solution, registring a new service may require a new method, in which case your code may break if you have already declared that method. To avoid that, please beware of the naming of your methods to avoid any conflicts.
Upgrade
Check the upgrade guide.
All versions of alice with dependencies
fakerphp/faker Version ^1.10
myclabs/deep-copy Version ^1.10
sebastian/comparator Version ^3.0 || ^4.0 || ^5.0 || ^6.0
symfony/property-access Version ^6.4 || ^7.0
symfony/yaml Version ^6.0 || ^7.0