Skip to content

Review parameter names in ext/pspell #6257

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 3 commits into from

Conversation

kocsismate
Copy link
Member

No description provided.


function pspell_check(int $pspell, string $word): bool {}
function pspell_check(int $dictionary_id, string $word): bool {}
Copy link
Member Author

Choose a reason for hiding this comment

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

since the manual describes the return value of pspell_new() as Returns the dictionary link identifier on success or FALSE on failure., I think it makes sense to rename $pspell to $directory_id (the manual refers to it as $directory_link).

Copy link
Member

Choose a reason for hiding this comment

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

O M G. Wow, this is even worse than usual! This extension uses resources, but instead of actually using them it works on resource IDs???

Copy link
Member

Choose a reason for hiding this comment

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

So, considering that we should migrate these resource IDs to objects in the future, we should name them with that in mind. And we did use the $mysql, $ldap etc convention before, so keeping this at $pspell would make sense to me. $dictionary_id is sensible now, but not if we ever migrate this to a non-integer.

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 had a suspicion for a second that these are really resource IDs, but I thought that it's impossible, so rejected the idea.. Crazy!

Copy link
Member Author

Choose a reason for hiding this comment

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

With that in mind, $pspell and$config seems the best choices for me as well.

@php-pulls php-pulls closed this in 4982964 Oct 5, 2020
@kocsismate kocsismate deleted the pspell-name branch October 5, 2020 13:23
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