Instantiate and get Faker.

@return \Faker\Generator|null
515705
public function getFaker()
    {
        if (is_null($this->faker) && class_exists($this->fakerClass)) {
            $this->faker = call_user_func("$this->fakerClass::create");
        }

        return $this->faker;
    }
518231
protected function getCloner()
    {
        if (!$this->cloner) {
            $clonerOptions = $this->getClonerOptions();
            if (isset($clonerOptions['casters'])) {
                $this->cloner = new VarCloner($clonerOptions['casters']);
            } else {
                $this->cloner = new VarCloner();
            }
            if (isset($clonerOptions['additional_casters'])) {
                $this->cloner->addCasters($clonerOptions['additional_casters']);
            }
            if (isset($clonerOptions['max_items'])) {
                $this->cloner->setMaxItems($clonerOptions['max_items']);
            }
            if (isset($clonerOptions['max_string'])) {
                $this->cloner->setMaxString($clonerOptions['max_string']);
            }
            // setMinDepth was added to Symfony 3.4:
            if (isset($clonerOptions['min_depth']) && method_exists($this->cloner, 'setMinDepth')) {
                $this->cloner->setMinDepth($clonerOptions['min_depth']);
            }
        }
        return $this->cloner;
    }
703792
public function instantiate()
    {
        $router = new Wildcard($this->entryPoint);
        $router->setLogger($this->app->getLogger());
        return $router;
    }
1210988
public function run(Factory $factory, Generator $faker)
    {
        $factory->define(\App\Http\Node\Model\ArticleExampleModel::class, function () use ($faker) {

            return [
                'title' => $faker->sentence($nbWords = 6, $variableNbWords = true),
                'description' => $faker->text($maxNbChars = 150),
                'date' => $faker->date($format = 'Y-m-d', $max = 'now')
            ];


        });

        factory(\App\Http\Node\Model\ArticleExampleModel::class, 50)->create();
    }
478842
public function getGenerator()
    {
        if ($this->_generator === null) {
            $language = $this->language === null ? Yii::$app->language : $this->language;
            $this->_generator = \Faker\Factory::create(str_replace('-', '_', $language));
        }
        return $this->_generator;
    }
197978
public function getInstantiator(): Instantiator
    {
        if (is_null($this->instantiator)) {
            $this->setInstantiator(new Instantiator(null, $this));
        }

        return $this->instantiator;
    }
872969
public function newInstance()
    {
        if ($this->prototype === null) {
            $this->prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));
        }

        return clone $this->prototype;
    }
344489
public static function getInstance()
    {
        if (null === self::$instance) {
            $class          = new \ReflectionClass(__CLASS__);
            self::$instance = $class->newInstanceArgs(func_get_args());
        }

        return self::$instance;
    }
538887
public static function instance(): self
    {
        if (!self::$instance) {
            self::$instance = new self(
                SpyFactory::instance(),
                MatcherFactory::instance(),
                MatcherVerifier::instance(),
                GeneratorVerifierFactory::instance(),
                IterableVerifierFactory::instance(),
                CallVerifierFactory::instance(),
                ExceptionAssertionRecorder::instance(),
                AssertionRenderer::instance(),
                FunctionHookManager::instance()
            );
        }

        return self::$instance;
    }
563373
def getGenerator(cls, locale=None, providers=None, codename=None):
        

        codename = codename or cls.getCodename(locale, providers)

        if codename not in cls.generators:
            from faker import Faker as FakerGenerator
            # initialize with faker.generator.Generator instance
            # and remember in cache
            cls.generators[codename] = FakerGenerator( locale, providers )
            cls.generators[codename].seed( cls.generators[codename].randomInt() )

        return cls.generators[codename]
1295931
public static function fake()
    {
        static::bootFaker();
        $params = func_get_args();
        $method = array_shift($params);

        return call_user_func_array(array(static::$faker, $method), $params);
    }
833740
public function obj()
    {
        if ($this->obj === null) {
            $this->obj = $this->createOrLoadObj();

            if ($this->obj instanceof ModelInterface) {
                $this->objId = $this->obj->id();
            } else {
                $this->objId = null;
            }
        }

        return $this->obj;
    }
181284
public function getProfiler() {
		if ($this->_profiler === null) {
			$this->_profiler = new Profiler();
			$this->onProfilerInit($this->_profiler);
		}
		
		return $this->_profiler;
	}
373848
public function instance()
    {
        $settings = $this->getValidatedSettings();

        $objectManager = $this->createObjectManager($settings);
        $logger = isset($settings['logger']) ? isset($settings['logger']) : null;

        $this->initializeRegistry($objectManager, $logger);

        return new DataMapper($objectManager);
    }
410886
public function get()
    {
        if ($this->requestId === null) {
            $this->requestId = $this->generator->generateRequestId();
        }

        return $this->requestId;
    }
310743
public function get()
    {
        $compiler = new ClassCompiler(
            $this->className,
            $this->niceMock,
            $this->constructorArgs,
            $this->disableConstructor,
            $this->disableClone
        );
        if ($this->customClassName) {
            $compiler->setCustomClassName($this->customClassName);
        }
        $compiler->setRules($this->rules);
        foreach ($this->expose as $method) {
            $compiler->addExpose($method);
        }
        $mockInstance = $compiler->newInstance();
        $this->testCase->addMockInstance($this, $mockInstance);
        $this->restoreState($mockInstance);

        foreach ($this->properties as $name => $value) {
            $this->testCase->setProperty($mockInstance, $name, $value);
        }

        return $mockInstance;
    }
660941
public static function getLogger()
    {
        $logger = null;
        try {
            $logger = Injector::inst()->get('SilverStripe\Omnipay\Logger');
        } catch (NotFoundExceptionInterface $e) {
            /* no op */
        }
        return $logger;
    }