-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Convert enchant resources to opaque objects #5577
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
Conversation
Additionally, deprecate ENCHANT_MYSPELL and ENCHANT_ISPELL constants. Co-authored-by: Remi Collet <remi@php.net>
8db5d60
to
ba1bc4d
Compare
|
||
/** @param resource $broker */ | ||
function enchant_broker_free($broker): bool {} | ||
final class EnchantDict |
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.
Could we use EnchantDictionary
instead? The usage of the Dict
abbreviation doesn't seem to fit PHP's recent naming strategy.
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'm okay either way.
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 used EnchantDictionary
RETURN_RES(dict->rsrc); | ||
object_init_ex(return_value, enchant_dict_ce); | ||
dict = Z_ENCHANT_DICT_P(return_value); | ||
dict->pdict =pdict; |
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.
dict->pdict =pdict; | |
dict->pdict = pdict; |
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.
Fixed this (as well as adding an upgrading notes) when committing to master
|
||
/** @param resource $broker */ | ||
function enchant_broker_free($broker): bool {} | ||
final class EnchantDict |
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'm okay either way.
I'm wondering if it is still ok to deprecate |
@kocsismate It's okay, imho. |
> Deprecate enchant_broker_set_dict_path, enchant_broker_get_dict_path > enchant_dict_add_to_personal and enchant_dict_is_in_session Ref: https://github.com/php/php-src/blob/c0172aa2bdb9ea223c8491bdb300995b93a857a0/NEWS#L71 > - enchant_broker_set_dict_path and enchant_broker_get_dict_path > not available in libenchant < 1.5 nor in libenchant-2 > - enchant_dict_add_to_personal, use enchant_dict_add instead > - enchant_dict_is_in_session, use enchant_dict_is_added instead > - enchant_broker_free and enchant_broker_free_dict, unset the object instead Refs: * https://github.com/php/php-src/blob/c0172aa2bdb9ea223c8491bdb300995b93a857a0/UPGRADING#L662-L666 * php/php-src#5492 * php/php-src@66d42e9 * php/php-src#5577 * php/php-src@cd3e04d Includes unit tests.
> ENCHANT_MYSPELL and ENCHANT_ISPELL constants Refs: * https://github.com/php/php-src/blob/c0172aa2bdb9ea223c8491bdb300995b93a857a0/UPGRADING#L667 * php/php-src#5577 * php/php-src@cd3e04d Includes unit tests.
> ENCHANT_MYSPELL and ENCHANT_ISPELL constants Refs: * https://github.com/php/php-src/blob/c0172aa2bdb9ea223c8491bdb300995b93a857a0/UPGRADING#L667 * php/php-src#5577 * php/php-src@cd3e04d Includes unit tests.
Additionally, deprecate ENCHANT_MYSPELL and ENCHANT_ISPELL constants.
This PR is essentially the same as the reverted 5318971 commit, minus the OO interface.