Skip to content

Commit efe6006

Browse files
committed
Review parameter names in ext/session
Closes GH-6239
1 parent aecb05f commit efe6006

File tree

2 files changed

+35
-25
lines changed

2 files changed

+35
-25
lines changed

ext/session/session.stub.php

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,35 +43,45 @@ function session_commit(): bool {}
4343
* @param callable|object $open
4444
* @param callable|bool $close
4545
*/
46-
function session_set_save_handler($open, $close = UNKNOWN, callable $read = UNKNOWN, callable $write = UNKNOWN, callable $destroy = UNKNOWN, callable $gc = UNKNOWN, callable $create_sid = UNKNOWN, callable $validate_sid = UNKNOWN, callable $update_timestamp = UNKNOWN): bool {}
46+
function session_set_save_handler(
47+
$open,
48+
$close = UNKNOWN,
49+
callable $read = UNKNOWN,
50+
callable $write = UNKNOWN,
51+
callable $destroy = UNKNOWN,
52+
callable $gc = UNKNOWN,
53+
callable $create_sid = UNKNOWN,
54+
callable $validate_sid = UNKNOWN,
55+
callable $update_timestamp = UNKNOWN
56+
): bool {}
4757

48-
function session_cache_limiter(?string $cache_limiter = null): string|false {}
58+
function session_cache_limiter(?string $value = null): string|false {}
4959

50-
function session_cache_expire(?int $new_cache_expire = null): int|false {}
60+
function session_cache_expire(?int $value = null): int|false {}
5161

52-
function session_set_cookie_params(array|int $lifetime_or_options, ?string $path = null, ?string $domain = null, ?bool $secure = null, ?bool $httponly = null): bool {}
62+
function session_set_cookie_params(array|int $lifetime_or_options, ?string $path = null, ?string $domain = null, ?bool $secure = null, ?bool $httponly = null): bool {}
5363

5464
function session_start(array $options = []): bool {}
5565

5666
interface SessionHandlerInterface
5767
{
5868
/** @return bool */
59-
public function open(string $save_path, string $session_name);
69+
public function open(string $path, string $name);
6070

6171
/** @return bool */
6272
public function close();
6373

6474
/** @return string */
65-
public function read(string $key);
75+
public function read(string $id);
6676

6777
/** @return bool */
68-
public function write(string $key, string $val);
78+
public function write(string $id, string $data);
6979

7080
/** @return bool */
71-
public function destroy(string $key);
81+
public function destroy(string $id);
7282

7383
/** @return int|bool */
74-
public function gc(int $maxlifetime);
84+
public function gc(int $max_lifetime);
7585
}
7686

7787
interface SessionIdInterface
@@ -83,31 +93,31 @@ public function create_sid();
8393
interface SessionUpdateTimestampHandlerInterface
8494
{
8595
/** @return bool */
86-
public function validateId(string $key);
96+
public function validateId(string $id);
8797

8898
/** @return bool */
89-
public function updateTimestamp(string $key, string $val);
99+
public function updateTimestamp(string $id, string $data);
90100
}
91101

92102
class SessionHandler implements SessionHandlerInterface, SessionIdInterface
93103
{
94104
/** @return bool */
95-
public function open(string $save_path, string $session_name) {}
105+
public function open(string $path, string $name) {}
96106

97107
/** @return bool */
98108
public function close() {}
99109

100110
/** @return string */
101-
public function read(string $key) {}
111+
public function read(string $id) {}
102112

103113
/** @return bool */
104-
public function write(string $key, string $val) {}
114+
public function write(string $id, string $data) {}
105115

106116
/** @return bool */
107-
public function destroy(string $key) {}
117+
public function destroy(string $id) {}
108118

109119
/** @return int|bool */
110-
public function gc(int $maxlifetime) {}
120+
public function gc(int $max_lifetime) {}
111121

112122
/** @return string */
113123
public function create_sid() {}

ext/session/session_arginfo.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 9bdf602c14822b13553a5214a415e312c21cd30c */
2+
* Stub hash: 8175feea632f2832e43d830e70dc9332377b9f22 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_session_name, 0, 0, MAY_BE_STRING|MAY_BE_FALSE)
55
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null")
@@ -70,11 +70,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_session_set_save_handler, 0, 1,
7070
ZEND_END_ARG_INFO()
7171

7272
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_session_cache_limiter, 0, 0, MAY_BE_STRING|MAY_BE_FALSE)
73-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, cache_limiter, IS_STRING, 1, "null")
73+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, value, IS_STRING, 1, "null")
7474
ZEND_END_ARG_INFO()
7575

7676
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_session_cache_expire, 0, 0, MAY_BE_LONG|MAY_BE_FALSE)
77-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, new_cache_expire, IS_LONG, 1, "null")
77+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, value, IS_LONG, 1, "null")
7878
ZEND_END_ARG_INFO()
7979

8080
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_session_set_cookie_params, 0, 1, _IS_BOOL, 0)
@@ -90,26 +90,26 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_session_start, 0, 0, _IS_BOOL, 0
9090
ZEND_END_ARG_INFO()
9191

9292
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SessionHandlerInterface_open, 0, 0, 2)
93-
ZEND_ARG_TYPE_INFO(0, save_path, IS_STRING, 0)
94-
ZEND_ARG_TYPE_INFO(0, session_name, IS_STRING, 0)
93+
ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0)
94+
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
9595
ZEND_END_ARG_INFO()
9696

9797
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SessionHandlerInterface_close, 0, 0, 0)
9898
ZEND_END_ARG_INFO()
9999

100100
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SessionHandlerInterface_read, 0, 0, 1)
101-
ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
101+
ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0)
102102
ZEND_END_ARG_INFO()
103103

104104
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SessionHandlerInterface_write, 0, 0, 2)
105-
ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
106-
ZEND_ARG_TYPE_INFO(0, val, IS_STRING, 0)
105+
ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0)
106+
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
107107
ZEND_END_ARG_INFO()
108108

109109
#define arginfo_class_SessionHandlerInterface_destroy arginfo_class_SessionHandlerInterface_read
110110

111111
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SessionHandlerInterface_gc, 0, 0, 1)
112-
ZEND_ARG_TYPE_INFO(0, maxlifetime, IS_LONG, 0)
112+
ZEND_ARG_TYPE_INFO(0, max_lifetime, IS_LONG, 0)
113113
ZEND_END_ARG_INFO()
114114

115115
#define arginfo_class_SessionIdInterface_create_sid arginfo_class_SessionHandlerInterface_close

0 commit comments

Comments
 (0)