-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Intl: Add a new IntlListFormatter class #18519
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
BogdanUngureanu
wants to merge
16
commits into
php:master
from
BogdanUngureanu:intl-add-list-formatter
+695
−0
Closed
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
ea1ee1c
Intl: Add IntlListFormatter class
BogdanUngureanu 9236166
Skip test if ICU is older than 67
BogdanUngureanu 29f0ebb
Call ZEND_PARSE_PARAMETERS_NONE in getErrorCode and getErrorMessage
BogdanUngureanu a2dd8e9
Make IntlListFormatter final, not serializable and use strict properties
BogdanUngureanu e31bfe4
Added more validation for parameters and fixed coding style
BogdanUngureanu 8524fdc
Attempt to fix the windows build failure
BogdanUngureanu a096a14
Simplify the implementation
BogdanUngureanu 7ef1380
Fix leak and simplify error handling
BogdanUngureanu 6852001
Add more tests
BogdanUngureanu 3851509
use safe_emalloc
BogdanUngureanu 1f64694
Hide unavailable constants for ICU < 67 and remove comments
BogdanUngureanu 7b55c89
update error message
BogdanUngureanu a7e9a29
use exception
BogdanUngureanu 5d2ca4c
disable cloning and use different functions
BogdanUngureanu c5917a8
Fix typo and code style
BogdanUngureanu a792f88
Remove redundant condition and add php closing tag in tests
BogdanUngureanu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
disable cloning and use different functions
- Loading branch information
commit 5d2ca4c5d5073fd6d59ba6aaa7df94a810fe6515
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,4 +58,4 @@ test, test2, and test | |
FR | ||
1, 2 et 3 | ||
1, 2 et 3 | ||
1.2, 2.3 et 3.4 | ||
1.2, 2.3 et 3.4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--TEST-- | ||
Test IntlListFormatter cannot be cloned | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('intl')) { | ||
die('skip intl extension not available'); | ||
} | ||
?> | ||
--FILE-- | ||
<?php | ||
|
||
$formatter = new IntlListFormatter('en_US', IntlListFormatter::TYPE_AND, IntlListFormatter::WIDTH_WIDE); | ||
|
||
try { | ||
$clonedFormatter = clone $formatter; | ||
} catch(Error $error) { | ||
echo $error->getMessage(); | ||
} | ||
|
||
?> | ||
--EXPECT-- | ||
Trying to clone an uncloneable object of class IntlListFormatter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,4 +123,4 @@ FR | |
1, 2 ou 3 | ||
1, 2 et 3 | ||
1, 2 et 3 | ||
1 2 3 | ||
1 2 3 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.