Last active
August 29, 2015 14:25
-
-
Save sveneisenschmidt/716419cd2f0343992a47 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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