Phly\Http\Response\Serializer::fromString PHP Метод

fromString() публичный статический Метод

Deserialize a response string to a response instance.
public static fromString ( string $message ) : Response
$message string
Результат Phly\Http\Response
    public static function fromString($message)
    {
        $stream = new Stream('php://temp', 'wb+');
        $stream->write($message);
        return static::fromStream($stream);
    }

Usage Example

Пример #1
0
 /**
  * @dataProvider messagesWithInvalidHeaders
  */
 public function testDeserializationRaisesExceptionForMalformedHeaders($message, $exceptionMessage)
 {
     $this->setExpectedException('UnexpectedValueException', $exceptionMessage);
     $response = Serializer::fromString($message);
 }