Skip to content

Review parameter names in ext/zlib #6250

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

Closed
wants to merge 1 commit into from

Conversation

kocsismate
Copy link
Member

No description provided.

@nikic
Copy link
Member

nikic commented Oct 1, 2020

I think something went wrong here, this only has a change in bz2 now.

@kocsismate
Copy link
Member Author

Weird.. For me, GitHub (also) shows that 9 files were changed. And I see everything I pushed. No idea what happened.

@@ -823,13 +823,13 @@ function ftell($stream): int|false {}
function fflush($stream): bool {}

/** @param resource $stream */
function fwrite($stream, string $string, ?int $max_length = null): int|false {}
function fwrite($stream, string $data, ?int $max_length = null): int|false {}
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure I see a compelling reason to deviate from the usual $string name here. For that matter, if we s/$data/$string in all those gz APIs, I don't think things get worse. Do they?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not opposed to use $string, but I'd prefer $data much more than $string since it describes the purpose of the parameter much better. And actually, we used $data in case of SessionHandler::write() and shmop_write(), that's why I'd like to follow the practice here as well

Copy link
Member

Choose a reason for hiding this comment

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

Okay, I'm fine with that. It might make sense to also adjust file_put_contents() while you're already here.

Copy link
Member Author

@kocsismate kocsismate Oct 5, 2020

Choose a reason for hiding this comment

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

I've just applied this to master

@@ -823,13 +823,13 @@ function ftell($stream): int|false {}
function fflush($stream): bool {}

/** @param resource $stream */
function fwrite($stream, string $string, ?int $max_length = null): int|false {}
function fwrite($stream, string $data, ?int $max_length = null): int|false {}
Copy link
Member

Choose a reason for hiding this comment

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

Okay, I'm fine with that. It might make sense to also adjust file_put_contents() while you're already here.

@php-pulls php-pulls closed this in e9c7072 Oct 5, 2020
@kocsismate kocsismate deleted the zlib-name branch October 5, 2020 13:24
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.

2 participants