Skip to content

Commit 78d394e

Browse files
OracleNepOracleNep
andauthored
[skip ci] ext/intl: Fix typos in error conventions (#22261)
Fix several typos in test and error convention doc in the intl extension. Co-authored-by: OracleNep <3377457402@qq.com>
1 parent e9e2418 commit 78d394e

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

ext/intl/ERROR_CONVENTIONS.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ conventions are enumerated in this document.
66
* The last error is always stored globally.
77

88
The global error code can be obtained in userland with `intl_get_error_code()`.
9-
This is a `U_*` error code defined by ICU, but it does not have necessarily to
10-
be returned obtained after a call to an ICU function. That is to say, the
9+
This is a `U_*` error code defined by ICU, but it is not necessarily obtained
10+
from a call to an ICU function. That is to say, the
1111
internal PHP wrapper functions can set these error codes when appropriate. For
1212
instance, in response to bad arguments (e.g. `zend_parse_parameters()` failure),
1313
the PHP wrapper function should set the global error code to
14-
`U_ILLEGAL_ARGUMENT_ERROR`).
14+
`U_ILLEGAL_ARGUMENT_ERROR`.
1515

16-
The error code (an integer) can be converter to the corresponding enum name
16+
The error code (an integer) can be converted to the corresponding enum name
1717
string in userland with `intl_error_name()`.
1818

1919
The associated message can be obtained with `intl_get_error_message()`. This is
@@ -60,23 +60,23 @@ void intl_errors_set(intl_error* err, UErrorCode code, char* msg, int copyMsg);
6060
```
6161
6262
by passing a pointer to the object's `intl_error` as the first parameter.
63-
Node the extra `s` in the functions' names (`errors`, not `error`).
63+
Note the extra `s` in the functions' names (`errors`, not `error`).
6464
6565
Static methods should only set the global error.
6666
6767
* Intl classes that can be instantiated should provide `::getErrorCode()` and
6868
`getErrorMessage()` methods.
6969
7070
These methods are used to retrieve the error codes stored in the object's
71-
private `intl_error` structured and mirror the global `intl_get_error_code()`
71+
private `intl_error` structure and mirror the global `intl_get_error_code()`
7272
and `intl_get_error_message()`.
7373
7474
* Intl methods and functions should return `FALSE` on error (even argument
7575
parsing errors), not `NULL`. Constructors and factory methods are the
7676
exception; these should return `NULL`, not `FALSE`.
7777
78-
Note that constructors in Intl generally (always?) don't throws exceptions. They
79-
instead destroy the object to that the result of new `IntlClass()` can be
78+
Note that constructors in Intl generally (always?) do not throw exceptions. They
79+
instead destroy the object so that the result of new `IntlClass()` can be
8080
`NULL`. This may be surprising.
8181
8282
* Intl functions and methods should reset the global error before doing anything

ext/intl/tests/bug75317.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var_dump($c->setSourceEncoding('utf-32'));
2929
printResult($c->getDestinationEncoding(), $utf8);
3030
printResult($c->getSourceEncoding(), $utf32);
3131

32-
// test invalid inputs dont change values
32+
// test invalid inputs don't change values
3333
var_dump($c->setDestinationEncoding('foobar') === false);
3434
var_dump($c->setSourceEncoding('foobar') === false);
3535
printResult($c->getDestinationEncoding(), $utf8);

0 commit comments

Comments
 (0)