<?php
// Own namespace
-namespace CoreFramework\Response;
+namespace Org\Mxchange\CoreFramework\Response;
// Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
/**
* An interface for responses
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
* @param $status New response status
* @return void
*/
- function setResponseStatus ($status);
+ function setResponseStatus (string $status);
/**
* Adds a header to the response. This method "wraps" the direct header()
* @param $value Value of header element
* @return void
*/
- function addHeader ($name, $value);
+ function addHeader (string $name, $value);
/**
* "Writes" data to the response body
* @param $output Output we shall sent in the HTTP response
* @return void
*/
- function writeToBody ($output);
+ function writeToBody (string $output);
/**
* Flushs the cached HTTP response to the outer world
* @throws ResponseHeadersAlreadySentException Thrown if headers are
* already sent
*/
- function flushBuffer ($force = FALSE);
+ function flushBuffer (bool $force = false);
/**
* Adds a fatal message id to the response. The added messages can then be
* @param $messageId The message id we shall add
* @return void
*/
- function addFatalMessage ($messageId);
+ function addFatalMessage (string $messageId);
/**
* Adds a cookie to the response
* @param $cookieName Cookie's name
* @param $cookieValue Value to store in the cookie
* @param $encrypted Do some extra encryption on the value
+ * @param $expires Timestamp of expiration (default: configured)
* @return void
* @throws ResponseHeadersAlreadySentException If headers are already sent
*/
- function addCookie ($cookieName, $cookieValue, $encrypted = FALSE);
+ function addCookie (string $cookieName, $cookieValue, bool $encrypted = FALSE, int $expires = NULL);
/**
* Redirect to a configured URL. The URL can be absolute or relative. In
* @return void
* @throws ResponseHeadersAlreadySentException If headers are already sent
*/
- function redirectToConfiguredUrl ($configEntry);
+ function redirectToConfiguredUrl (string $configEntry);
/**
* Expires the given cookie if it is set
* @param $cookieName Cookie to expire
* @return void
*/
- function expireCookie ($cookieName);
+ function expireCookie (string $cookieName);
/**
* Refreshs a given cookie. This will make the cookie live longer
* @param $cookieName Cookie to refresh
* @return void
*/
- function refreshCookie ($cookieName);
+ function refreshCookie (string $cookieName);
}