-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Translation] Make IcuDatFileLoader/IcuResFileLoader::load invalid resource compatible with HHVM. #10697
Conversation
$rb = new \ResourceBundle($locale, $resource); | ||
} catch (\Exception $e) { | ||
// HHVM compatibility: constructor throws on invalid resource | ||
$rb = null; |
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.
should be false
, right?
There are other occurrences of this pattern in |
Also, it looks like that it returns |
Thanks, I meant to write From the documentation it seems it should return If it does return false, then |
I've tested it and it does return |
…or invalid resource bundle compatible with HHVM.
Confirmed, I've made the changes and updated the other two classes. Is there a reason to use |
We always do a strict comparisation of |
Thanks @idn2104. |
… invalid resource compatible with HHVM. (idn2104) This PR was squashed before being merged into the 2.3 branch (closes #10697). Discussion ---------- [Translation] Make IcuDatFileLoader/IcuResFileLoader::load invalid resource compatible with HHVM. [Translation] HHVM throws when an invalid ResourceBundle is constructed, while zend returns FALSE from the constructor. This patch makes IcuResFileLoader and IcuDatFileLoader compatible with HHVM. The following tests now pass on HHVM: https://github.com/symfony/symfony/blob/2.3/src/Symfony/Component/Translation/Tests/Loader/IcuDatFileLoaderTest.php#L33 https://github.com/symfony/symfony/blob/2.3/src/Symfony/Component/Translation/Tests/Loader/IcuResFileLoaderTest.php#L54 | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | N/A Commits ------- 9bc08c0 [Translation] Make IcuDatFileLoader/IcuResFileLoader::load invalid resource compatible with HHVM.
[Translation] HHVM throws when an invalid ResourceBundle is constructed, while zend returns FALSE from the constructor. This patch makes IcuResFileLoader and IcuDatFileLoader compatible with HHVM.
The following tests now pass on HHVM:
https://github.com/symfony/symfony/blob/2.3/src/Symfony/Component/Translation/Tests/Loader/IcuDatFileLoaderTest.php#L33
https://github.com/symfony/symfony/blob/2.3/src/Symfony/Component/Translation/Tests/Loader/IcuResFileLoaderTest.php#L54