Just to be clear, there are a few ways to format this properly (according to PSR2):

```php
if (mt_rand() / mt_getrandmax() <= $weight) {
    // Return the formatter
    return $this->generator;
} else {
    // Return NULL
    return new \Faker\NullGenerator();
}
```

or 

```php
if (mt_rand() / mt_getrandmax() <= $weight) {
    // Return the formatter
    return $this->generator;
}
// Return NULL
return new \Faker\NullGenerator();
```

But I don't think the comments are needed, the code speaks for itself. My personal preference would go to:

```php
if (mt_rand() / mt_getrandmax() <= $weight) {
    return $this->generator;
}
return new \Faker\NullGenerator();
```