write() public méthode

Proxies to the underlying stream and writes the provided data to it.
public write ( string $data ) : self
$data string
Résultat self
 /**
  * Write the given message to the response and mark it complete.
  *
  * If the message is an Http\Response decorator, call and return its
  * `end()` method; otherwise, decorate the response and `end()` it.
  *
  * @param ResponseInterface $response
  * @param string $message
  * @return Http\Response
  */
 private function completeResponse(ResponseInterface $response, $message)
 {
     if ($response instanceof Http\Response) {
         return $response->write($message);
     }
     $response = new Http\Response($response);
     return $response->write($message);
 }
 public function testCanReplaceOriginalResponseAndBodySizeAfterConstruction()
 {
     $psrResponse = new PsrResponse();
     $originalResponse = new Response(new PsrResponse());
     $originalResponse->write('foo');
     $final = new FinalHandler([], $psrResponse);
     $final->setOriginalResponse($originalResponse);
     /** @var Response $actualResponse */
     $actualResponse = self::readAttribute($final, 'response');
     $this->assertSame($originalResponse, $actualResponse);
     $this->assertSame(3, $actualResponse->getBody()->getSize());
 }
 /**
  * @group 12
  */
 public function testReturnsResponseIfBodyLengthHasChanged()
 {
     $psrResponse = new PsrResponse();
     $response = new Response($psrResponse);
     $final = new FinalHandler([], $response);
     $response->write('return this response');
     $result = $final(new Request(new PsrRequest()), $response);
     $this->assertSame($response, $result);
 }