Skip to content

Make the return type of some stream context related functions true #12720

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

Merged
merged 3 commits into from
Nov 19, 2023

Conversation

kocsismate
Copy link
Member

Before the slight refactoring, it wasn't obvious that the related functions could only return true.

Before the slight refactoring, it wasn't obvious that the related functions could only return true.
Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

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

I verified that the semantic change is right: all failure paths indeed throw an exception, so it is impossible to return true.
Found one mistake though.

Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

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

LGTM if CI is happy


try {
stream_context_create(['ssl' => ['verify_peer'=> false]], ["options" => false]);
} catch (ValueError $exception) {
Copy link
Member

Choose a reason for hiding this comment

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

Should be a TypeError

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

LGTM after test fix and if CI is then happy.

@kocsismate kocsismate force-pushed the stream-context-return branch from 2fef794 to 9762421 Compare November 19, 2023 17:00
@kocsismate kocsismate merged commit ed6e289 into php:master Nov 19, 2023
@kocsismate kocsismate deleted the stream-context-return branch November 19, 2023 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants