From 0ef2da19b554e1ca2f0d399fa4d863fd1b36cfd0 Mon Sep 17 00:00:00 2001 From: lamentxu <1372449351@qq.com> Date: Fri, 3 Apr 2026 16:19:16 +0800 Subject: [PATCH 1/2] /ext/intl: fix various typo --- ext/intl/ERROR_CONVENTIONS.md | 4 ++-- ext/intl/collator/collator_convert.cpp | 2 +- ext/intl/collator/collator_sort.cpp | 2 +- ext/intl/formatter/formatter_data.cpp | 2 +- ext/intl/intl_error.h | 2 +- ext/intl/locale/locale_methods.cpp | 4 ++-- ext/intl/transliterator/transliterator_class.cpp | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ext/intl/ERROR_CONVENTIONS.md b/ext/intl/ERROR_CONVENTIONS.md index 432862afd6855..5e4d7236eb68a 100644 --- a/ext/intl/ERROR_CONVENTIONS.md +++ b/ext/intl/ERROR_CONVENTIONS.md @@ -40,7 +40,7 @@ no way to pass ownership of the string without it being copied. unless the error is due to bad arguments, in which case only the global error should be set. -Objects store an intl_error structed in their private data. For instance: +Objects store an intl_error structured in their private data. For instance: ```c typedef struct { @@ -59,7 +59,7 @@ void intl_errors_set_code(intl_error* err, UErrorCode err_code); void intl_errors_set(intl_error* err, UErrorCode code, char* msg, int copyMsg); ``` -by passing a pointer to the object's `intl_error` structed as the first parameter. +by passing a pointer to the object's `intl_error` structured as the first parameter. Node the extra `s` in the functions' names (`errors`, not `error`). Static methods should only set the global error. diff --git a/ext/intl/collator/collator_convert.cpp b/ext/intl/collator/collator_convert.cpp index d4de15aa0b822..aa49661f8d770 100644 --- a/ext/intl/collator/collator_convert.cpp +++ b/ext/intl/collator/collator_convert.cpp @@ -289,7 +289,7 @@ U_CFUNC zval* collator_convert_string_to_double( zval* str, zval *rv ) /* {{{ collator_convert_string_to_number_if_possible * - * Convert string to numer. + * Convert string to number. * * @param zval* str String to convert. * diff --git a/ext/intl/collator/collator_sort.cpp b/ext/intl/collator/collator_sort.cpp index 003d7f45a837f..2f8685e61e30c 100644 --- a/ext/intl/collator/collator_sort.cpp +++ b/ext/intl/collator/collator_sort.cpp @@ -380,7 +380,7 @@ U_CFUNC PHP_FUNCTION( collator_sort_with_sort_keys ) if( !hash || zend_hash_num_elements( hash ) == 0 ) RETURN_TRUE; - /* Create bufers */ + /* Create buffers */ sortKeyBuf = reinterpret_cast(ecalloc( sortKeyBufSize, sizeof( char ) )); sortKeyIndxBuf = reinterpret_cast(ecalloc( sortKeyIndxBufSize, sizeof( uint8_t ) )); utf16_buf = eumalloc( utf16_buf_size ); diff --git a/ext/intl/formatter/formatter_data.cpp b/ext/intl/formatter/formatter_data.cpp index 095be92ed29e1..a9e48d0b14d85 100644 --- a/ext/intl/formatter/formatter_data.cpp +++ b/ext/intl/formatter/formatter_data.cpp @@ -32,7 +32,7 @@ void formatter_data_init( formatter_data* nf_data ) /* }}} */ /* {{{ void formatter_data_free( formatter_data* nf_data ) - * Clean up mem allocted by internals of formatter_data + * Clean up mem allocated by internals of formatter_data */ void formatter_data_free( formatter_data* nf_data ) { diff --git a/ext/intl/intl_error.h b/ext/intl/intl_error.h index 8a9bff0b271c0..d8d9fac97bf29 100644 --- a/ext/intl/intl_error.h +++ b/ext/intl/intl_error.h @@ -37,7 +37,7 @@ void intl_error_set( intl_error* err, UErrorCode code, const char* msg); UErrorCode intl_error_get_code( intl_error* err ); zend_string* intl_error_get_message( intl_error* err ); -// Wrappers to synchonize object's and global error structures. +// Wrappers to synchronize object's and global error structures. void intl_errors_reset( intl_error* err ); void intl_errors_set_custom_msg( intl_error* err, const char* msg); void intl_errors_set_code( intl_error* err, UErrorCode err_code ); diff --git a/ext/intl/locale/locale_methods.cpp b/ext/intl/locale/locale_methods.cpp index 8f09e5c116e11..cff62b503395f 100644 --- a/ext/intl/locale/locale_methods.cpp +++ b/ext/intl/locale/locale_methods.cpp @@ -254,7 +254,7 @@ static zend_off_t getStrrtokenPos(char* str, zend_off_t savedPos) } } if(result < 1){ - /* Just in case inavlid locale e.g. '-x-xyz' or '-sl_Latn' */ + /* Just in case invalid locale e.g. '-x-xyz' or '-sl_Latn' */ result =-1; } return result; @@ -362,7 +362,7 @@ static zend_string* get_icu_value_internal( const char* loc_name , const char* t if( strcmp(tag_name , LOC_LANG_TAG)==0 ){ return zend_string_init(loc_name, strlen(loc_name), 0); } else { - /* Since Grandfathered , no value , do nothing , retutn NULL */ + /* Since Grandfathered , no value , do nothing , return NULL */ return NULL; } } diff --git a/ext/intl/transliterator/transliterator_class.cpp b/ext/intl/transliterator/transliterator_class.cpp index fd0cd4f3c3e64..3525872d77f60 100644 --- a/ext/intl/transliterator/transliterator_class.cpp +++ b/ext/intl/transliterator/transliterator_class.cpp @@ -80,7 +80,7 @@ static void transliterator_object_init( Transliterator_object* to ) /* }}} */ /* {{{ void transliterator_object_destroy( Transliterator_object* to ) - * Clean up mem allocted by internals of Transliterator_object + * Clean up mem allocated by internals of Transliterator_object */ static void transliterator_object_destroy( Transliterator_object* to ) { From 5ac834c7fc8c54b8c51b2e7f3f2797c2255c43e2 Mon Sep 17 00:00:00 2001 From: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Date: Sat, 4 Apr 2026 00:03:37 +0800 Subject: [PATCH 2/2] [skip ci] Apply suggestions from code review Co-authored-by: Ilija Tovilo --- ext/intl/ERROR_CONVENTIONS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/intl/ERROR_CONVENTIONS.md b/ext/intl/ERROR_CONVENTIONS.md index 5e4d7236eb68a..4b29101a0a868 100644 --- a/ext/intl/ERROR_CONVENTIONS.md +++ b/ext/intl/ERROR_CONVENTIONS.md @@ -40,7 +40,7 @@ no way to pass ownership of the string without it being copied. unless the error is due to bad arguments, in which case only the global error should be set. -Objects store an intl_error structured in their private data. For instance: +Objects store an intl_error in their private data. For instance: ```c typedef struct { @@ -59,7 +59,7 @@ void intl_errors_set_code(intl_error* err, UErrorCode err_code); void intl_errors_set(intl_error* err, UErrorCode code, char* msg, int copyMsg); ``` -by passing a pointer to the object's `intl_error` structured as the first parameter. +by passing a pointer to the object's `intl_error` as the first parameter. Node the extra `s` in the functions' names (`errors`, not `error`). Static methods should only set the global error.