Skip to content

Commit

Permalink
Merge pull request #188 from tshelburne/2.0-docs
Browse files Browse the repository at this point in the history
Added new documentation for 2.0
  • Loading branch information
tshelburne committed May 10, 2015
2 parents f5d5fdf + fab002f commit ff45f59
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
### 2.0.0 (2015-03-17)

* Expanded public interface of the `Loader` class to support:
- Trivial parsing of new document types
- Custom instantiation methods
- Custom setting of properties
- Custom processing and fixture building
* Added support for using parameters with the following
```
parameters:
foo: value
Acme\ClassName:
property: <{foo}>
```
### 1.7.2 (2014-10-10)
* Fixed support for custom providers, using addProvider instead of setProviders lets you add single providers
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ $persister->persist($objects);

This loader maintains its list of built objects, so `load` can be called multiple times with different files if your fixture file starts growing unmanageably large.

Using the `Loader` class directly also allows you to add more customization to how your objects are instantiated, properties are set, and what kinds of files you can parse. The following methods are all available for these purposes:

* `addParser`: Parsers handle new types of files
* `addProcessor`: Processors handle new ways to generate properties
* `addBuilder`: Builders handle the generation of fixtures themselves
* `addInstantiator`: Instantiators handle creating instances
* `addPopulator`: Populators handle setting properties on instances

> **Note**: To load plain PHP files, the files must return an array containing the same structure as the yaml files have.
## Reference ##
Expand Down
20 changes: 20 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# Breaking changes between Alice 1.x and 2.0

Support for PHP 5.3 has been removed (most notably, we're using short array syntax), and we are no longer testing in CI against 5.3.

In php fixtures, and nested faker blocks in yml fixtures, using `$this->fake()`
or `$loader->fake()` is no longer supported.

A closure is provided so you can now use the shorter `$fake()` instead.

# New public interface

## Fixtures

The `Fixtures` interface has not been altered.

## Loader

The public interface of the `Loader` class has been expanded to include the following methods:

* `addParser`: Parsers handle new types of files
* `addProcessor`: Processors handle new ways to generate properties
* `addBuilder`: Builders handle the generation of fixtures themselves
* `addInstantiator`: Instantiators handle creating instances
* `addPopulator`: Populators handle setting properties on instances

All of the feature set of Alice 1.x that was previously in the `Loader` class has been pieced out into the handlers mentioned above - a quick glance at the class names will probably explain their purpose as well as any documentation could.

0 comments on commit ff45f59

Please sign in to comment.