From eb6f0cefd683cea65a1afcd07344dc4a12a34695 Mon Sep 17 00:00:00 2001 From: Joanhey Date: Fri, 15 Sep 2023 23:19:25 +0200 Subject: [PATCH] Clean Apdater functions --- src/functions/AdapterFunctions.php | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/functions/AdapterFunctions.php b/src/functions/AdapterFunctions.php index b330a6c..5f30348 100644 --- a/src/functions/AdapterFunctions.php +++ b/src/functions/AdapterFunctions.php @@ -19,17 +19,14 @@ * * @link https://php.net/manual/en/function.header.php */ -function header(string $content, bool $replace = true, int $http_response_code = 0): void +function header(string $header, bool $replace = true, int $response_code = 0): void { - Http::header($content, $replace, $http_response_code); + Http::header($header, $replace, $response_code); } /** * Remove previously set headers * - * @param string $name The header name to be removed. This parameter is case-insensitive. - * @return void - * * @link https://php.net/manual/en/function.header-remove.php */ function header_remove(?string $name = null): void @@ -40,9 +37,6 @@ function header_remove(?string $name = null): void /** * Get or Set the HTTP response code * - * @param integer $code [optional] The optional response_code will set the response code. - * @return integer The current response code. By default the return value is int(200). - * * @link https://www.php.net/manual/en/function.http-response-code.php */ function http_response_code(int $code = null): int @@ -85,22 +79,13 @@ function getallheaders(): array /** * Send a cookie * - * @param string $name - * @param string $value - * @param int|array $expires - * @param string $path - * @param string $domain - * @param boolean $secure - * @param boolean $httponly - * @return boolean - * * @link https://php.net/manual/en/function.setcookie.php */ function setcookie(string $name, string $value = '', int|array $expires = 0, string $path = '', string $domain = '', bool $secure = false, bool $httponly = false): bool { $samesite = ''; if (is_array($expires)) { // Alternative signature available as of PHP 7.3.0 (not supported with named parameters) - $expires = $expires['expires'] ?? 0; + $expires = $expires['lifetime'] ?? 0; $path = $expires['path'] ?? ''; $domain = $expires['domain'] ?? ''; $secure = $expires['secure'] ?? false; @@ -116,8 +101,7 @@ function setcookie(string $name, string $value = '', int|array $expires = 0, str /** * Limits the maximum execution time * - * @param int $seconds - * @return bool + * @link https://php.net/manual/en/function.set-time-limit.php */ function set_time_limit(int $seconds): bool {