Skip to content

Instantly share code, notes, and snippets.

@sveneisenschmidt
Last active August 29, 2015 14:25
Show Gist options
  • Save sveneisenschmidt/716419cd2f0343992a47 to your computer and use it in GitHub Desktop.
Save sveneisenschmidt/716419cd2f0343992a47 to your computer and use it in GitHub Desktop.
<?php
namespace Nelmio\Alice\Util;
use \Nelmio\Alice\Instances\Processor\Processable;
use \Nelmio\Alice\Instances\Processor\Methods\Faker;
class FakerFacade
{
/**
* @var \Nelmio\Alice\Instances\Processor\Methods\Faker
*/
protected $method;
/**
*
* @param array $providers
* @return \Nelmio\Alice\Util\FakerFacade
*/
public function create($providers = [])
{
return new self($providers);
}
/**
*
* @param array $providers
*/
public function __construct($providers = [])
{
$this->method = new Faker($providers);
}
/**
*
* @param string $value
* @param array $variables
* @return string
*/
public function process($value, $variables = [])
{
$processable = new Processable($value);
$result = $this->method->process($processable, $variables);
unset($processable);
return $result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment