API

Overview of the bitframe-diactoros package including classes and their methods and properties

View Source

namespace BitFrame\Message;

use \Psr\Http\Message\ServerRequestInterface;
use \Psr\Http\Message\ResponseInterface;
use \Psr\Http\Server\RequestHandlerInterface;
use \Zend\Diactoros\Response\EmitterInterface;


// implements:
use \Psr\Http\Server\MiddlewareInterface;

// uses:
use \BitFrame\Delegate\CallableMiddlewareTrait;

// exceptions:
use \RuntimeException

/**
 * Zend Diactoros wrapper class to emit http response
 * as a middleware.
 */
class DiactorosResponseEmitter 
    implements MiddlewareInterface
{
    use CallableMiddlewareTrait;
    
    /** @var EmitterInterface */
    private $emitter;
    
    /** @var bool */
    private $forceEmit;

    /**
     * @var EmitterInterface|null $emitter (optional, default: null)
     */
    public function __construct(  );
    
    /**
     * Process an incoming server request and return a
     * response, optionally delegating response creation
     * to a handler.
     *
     * @param ServerRequestInterface $request
     * @param RequestHandlerInterface $handler
     *
     * @return ResponseInterface
     *
     * @throws RuntimeException
     */
    public function process(  ): ResponseInterface;

    /**
     * Get Emitter.
     *
     * @return EmitterInterface
     */
    public function getEmitter(): EmitterInterface;

    /**
     * Set Emitter.
     *
     * @param EmitterInterface $emitter
     *
     * @return $this
     */
    public function setEmitter(  ): self;
    
    
    /**
     * Get flag that determines whether the response is 
     * going to forcefully emitted when headers have 
     * already been sent.
     *
     * @return bool
     */
    public function isForceEmit(): bool;
    
    
    /**
     * Set flag that determines whether the response is 
     * going to forcefully emitted when headers have 
     * already been sent.
     * 
     * @param bool $forceEmit
     *
     * @return $this
     */
    public function setForceEmit(  ): self;
    
    /**
     * Filter a header name to wordcase
     *
     * @param string $header
     * @return string
     */
    private function filterHeader(  );
}

Comments

Let us know if you have something to say or add