Coduo\TuTu\Config\Element\Response::fromArray PHP Method

fromArray() public static method

public static fromArray ( array $arrayConfig )
$arrayConfig array
    public static function fromArray(array $arrayConfig)
    {
        $configResolver = self::createArrayResponseResolver();
        $config = $configResolver->resolve($arrayConfig);
        $responseConfig = new Response($config['content'], $config['status'], $config['headers']);
        return $responseConfig;
    }

Usage Example

Example #1
0
 /**
  * @param array $arrayConfig
  * @return Element
  */
 public static function fromArray(array $arrayConfig)
 {
     $configResolver = self::createArrayConfigResolver();
     $config = $configResolver->resolve($arrayConfig);
     $responseConfig = new Element(Request::fromArray($config['request']), Response::fromArray($config['response']));
     return $responseConfig;
 }