l11n = new Localization(); $this->timestamp = \time(); } /** * Set header locked. * * @return void * * @since 1.0.0 */ public function lock() : void { $this->isLocked = true; } /** * Is header locked? * * @return bool * * @since 1.0.0 */ public function isLocked() : bool { return $this->isLocked; } /** * Generate header based on status code. * * @param int $statusCode Status code * * @return void * * @since 1.0.0 */ abstract public function generate(int $statusCode) : void; /** * Get protocol version. * * @return string * * @since 1.0.0 */ abstract public function getProtocolVersion() : string; /** * Set header. * * @param string $key Header key * @param string $value Header value * @param bool $overwrite Overwrite if key already exists * * @return bool * * @since 1.0.0 */ abstract public function set(string $key, string $value, bool $overwrite = false) : bool; /** * Get header by key. * * @param null|string $key Header key * * @return array * * @since 1.0.0 */ abstract public function get(string $key = null) : array; /** * Header has key? * * @param string $key Header key * * @return bool * * @since 1.0.0 */ abstract public function has(string $key) : bool; /** * Get time of the request * * @return int * * @since 1.0.0 */ public function getRequestTime() : int { return $this->timestamp; } /** * Push all headers. * * @return void * * @since 1.0.0 * @codeCoverageIgnore */ public function push() : void { } }