0 follower

Final Class Yiisoft\PsrEmitter\FakeEmitter

InheritanceYiisoft\PsrEmitter\FakeEmitter
ImplementsYiisoft\PsrEmitter\EmitterInterface

FakeEmitter is a test implementation of EmitterInterface that captures the last emitted response.

Method Details

Hide inherited methods

emit() public method

public void emit ( \Psr\Http\Message\ResponseInterface $response )
$response \Psr\Http\Message\ResponseInterface

                public function emit(ResponseInterface $response): void
{
    $this->response = $response;
}

            
getLastResponse() public method

public \Psr\Http\Message\ResponseInterface|null getLastResponse ( )
return \Psr\Http\Message\ResponseInterface|null

The last emitted response or null if no response has been emitted.

                public function getLastResponse(): ?ResponseInterface
{
    return $this->response;
}