to() public method

Converts the data in the record set to a different format, i.e. an array. Available options: array, url, context, or string.
public to ( string $format, array $options = [] ) : mixed
$format string Format to convert to.
$options array
return mixed
Example #1
0
 public function testConstruct()
 {
     $expected = array('scheme' => 'http', 'host' => 'localhost', 'port' => '80', 'path' => null, 'username' => null, 'password' => null, 'body' => array());
     $message = new Message($expected);
     $result = $message->to('array');
     $this->assertEqual($expected, $result);
 }