X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=framework%2Fmain%2Finterfaces%2Fresponse%2Fclass_Responseable.php;h=5223089c36dd907641126051da7ba8bbab3116b5;hp=f79ada00b89e5367b7b87510d81cb64c4814a136;hb=HEAD;hpb=f57dd51863ec9baacba447d76b46d5c709b9b02e diff --git a/framework/main/interfaces/response/class_Responseable.php b/framework/main/interfaces/response/class_Responseable.php index f79ada00..6c0290b7 100644 --- a/framework/main/interfaces/response/class_Responseable.php +++ b/framework/main/interfaces/response/class_Responseable.php @@ -10,7 +10,7 @@ use Org\Mxchange\CoreFramework\Generic\FrameworkInterface; * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2019 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 * @@ -34,7 +34,7 @@ interface Responseable extends FrameworkInterface { * @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() @@ -47,7 +47,7 @@ interface Responseable extends FrameworkInterface { * @param $value Value of header element * @return void */ - function addHeader ($name, $value); + function addHeader (string $name, $value); /** * "Writes" data to the response body @@ -55,7 +55,7 @@ interface Responseable extends FrameworkInterface { * @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 @@ -66,7 +66,7 @@ interface Responseable extends FrameworkInterface { * @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 @@ -75,7 +75,7 @@ interface Responseable extends FrameworkInterface { * @param $messageId The message id we shall add * @return void */ - function addFatalMessage ($messageId); + function addFatalMessage (string $messageId); /** * Adds a cookie to the response @@ -83,10 +83,11 @@ interface Responseable extends FrameworkInterface { * @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 @@ -97,7 +98,7 @@ interface Responseable extends FrameworkInterface { * @return void * @throws ResponseHeadersAlreadySentException If headers are already sent */ - function redirectToConfiguredUrl ($configEntry); + function redirectToConfiguredUrl (string $configEntry); /** * Expires the given cookie if it is set @@ -105,7 +106,7 @@ interface Responseable extends FrameworkInterface { * @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 @@ -113,6 +114,6 @@ interface Responseable extends FrameworkInterface { * @param $cookieName Cookie to refresh * @return void */ - function refreshCookie ($cookieName); + function refreshCookie (string $cookieName); }