New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more specific return type of session_status #10861
base: 5.x
Are you sure you want to change the base?
Conversation
I don't think constants are supported in callmaps. |
@weirdan could they be supported? I can look into this if this would be helpful |
You can put constant values there. |
@@ -11121,7 +11121,7 @@ | |||
'session_set_save_handler' => ['bool', 'open'=>'callable(string,string):bool', 'close'=>'callable():bool', 'read'=>'callable(string):string', 'write'=>'callable(string,string):bool', 'destroy'=>'callable(string):bool', 'gc'=>'callable(string):bool', 'create_sid='=>'callable():string', 'validate_sid='=>'callable(string):bool', 'update_timestamp='=>'callable(string):bool'], | |||
'session_set_save_handler\'1' => ['bool', 'open'=>'SessionHandlerInterface', 'close='=>'bool'], | |||
'session_start' => ['bool', 'options='=>'array'], | |||
'session_status' => ['int'], | |||
'session_status' => ['PHP_SESSION_ACTIVE|PHP_SESSION_NONE|PHP_SESSION_ACTIVE'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'session_status' => ['PHP_SESSION_ACTIVE|PHP_SESSION_NONE|PHP_SESSION_ACTIVE'], | |
'session_status' => ['1|2'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also you had a duplicate there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a different approach. Hope it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's clever, but I would prefer values though. Many of the constants in PHP are not really constants - e.g. PHP_BINARY
, PHP_INT_SIZE
, PASSWORD_DEFAULT
, etc. Using constants in the callmap the way you did establishes an unsafe example for future contributors / maintainers who may not be necessarily aware of those details.
@@ -13860,7 +13860,7 @@ | |||
'session_set_save_handler' => ['bool', 'open'=>'callable(string,string):bool', 'close'=>'callable():bool', 'read'=>'callable(string):string', 'write'=>'callable(string,string):bool', 'destroy'=>'callable(string):bool', 'gc'=>'callable(string):bool', 'create_sid='=>'callable():string', 'validate_sid='=>'callable(string):bool', 'update_timestamp='=>'callable(string):bool'], | |||
'session_set_save_handler\'1' => ['bool', 'open'=>'SessionHandlerInterface', 'close='=>'bool'], | |||
'session_start' => ['bool', 'options='=>'array'], | |||
'session_status' => ['int'], | |||
'session_status' => ['PHP_SESSION_ACTIVE|PHP_SESSION_NONE|PHP_SESSION_ACTIVE'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'session_status' => ['PHP_SESSION_ACTIVE|PHP_SESSION_NONE|PHP_SESSION_ACTIVE'], | |
'session_status' => ['1|2'], |
Return value of this function may be only one of 3 session status constants.