Fakerino\Core\OutPutFactory::getOutput PHP Method

getOutput() public static method

Returns a string output.
public static getOutput ( string $class, string | array | null $options = null ) : string | array
$class string
$options string | array | null
return string | array
    public static function getOutput($class, $options = null)
    {
        $fakeClass = new $class($options);
        $generatorName = $fakeClass->generatedBy();
        $generator = new $generatorName();
        $generator->setCaller($fakeClass);
        return $generator->generate();
    }

Usage Example

Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function getOutput($class, $options = null)
 {
     if (!array_key_exists(self::$fakeElement, self::$outputContainer)) {
         self::$outputContainer[self::$fakeElement] = array($class, $options);
     }
     return OutPutFactory::getOutput($class, $options);
 }
OutPutFactory