Skip to content

Add more specific array return type hints for various extensions - part 5 #7471

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

Open
wants to merge 2 commits into
base: PHP-8.1
Choose a base branch
from

Conversation

kocsismate
Copy link
Member

No description provided.

/**
* @return array<string, string>|false
* @alias litespeed_response_headers
*/
function apache_response_headers(): array|false {}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike other SAPIs, litespeed makes apache_request_headers() and apache_response_headers() an alias of its own implementations. The former one can be safely changed (so that litespeed_request_headers() becomes the alias of apache_request_headers()), however the latter one cannot, since the return type is different (array|false vs array). Can we somehow remove the false return? Or what could we do in order to add apache_response_headers() to the optimizer func info?

@kocsismate kocsismate changed the base branch from master to PHP-8.1 September 6, 2021 18:50
@kocsismate kocsismate closed this Sep 6, 2021
@kocsismate kocsismate reopened this Sep 6, 2021
@kocsismate kocsismate added the Type Information Label should be used whenever a pull request is working to improve type information for core or o+ label Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type Information Label should be used whenever a pull request is working to improve type information for core or o+
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant