fzaninotto/Faker — pull request #166 by weotch (2013-08-23 18:47:50+00:00)
Title: Adding a chainable property that will randomly return NULL

All formatters can be made optional by chaining `optional`. When optional, the formatter will randomly return `NULL`, which can be useful for seeding non-required fields. For example:

$faker->optional->country

You can skew the randomization towards more nulls or less by passing an argument to `optional()`. At 0, *only* `NULL` is returned. At 1, it is never returned.

$faker->optional(.75)->country