first commit
This commit is contained in:
30
vendor/fakerphp/faker/src/Faker/Extension/GeneratorAwareExtensionTrait.php
vendored
Normal file
30
vendor/fakerphp/faker/src/Faker/Extension/GeneratorAwareExtensionTrait.php
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Faker\Extension;
|
||||
|
||||
use Faker\Generator;
|
||||
|
||||
/**
|
||||
* A helper trait to be used with GeneratorAwareExtension.
|
||||
*/
|
||||
trait GeneratorAwareExtensionTrait
|
||||
{
|
||||
/**
|
||||
* @var Generator|null
|
||||
*/
|
||||
private $generator;
|
||||
|
||||
/**
|
||||
* @return static
|
||||
*/
|
||||
public function withGenerator(Generator $generator): Extension
|
||||
{
|
||||
$instance = clone $this;
|
||||
|
||||
$instance->generator = $generator;
|
||||
|
||||
return $instance;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user