-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Decouple I18n\View\Helper\AbstractTranslatorHelper from ext\intl #4380
Conversation
+1 |
{ | ||
parent::__construct(); | ||
|
||
$this->timeType = IntlDateFormatter::LONG; |
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.
You are missing the exception in this area.
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.
@mwillbanks It's thrown by the parent constructor.
Please also supply unit tests to verify the behavior. |
@mwillbanks there is no test written for other extension checking like and many others. Btw, I'll be happy to create tests if anyone can make a Travis build without |
@@ -12,6 +12,7 @@ | |||
use Locale; | |||
use IntlDateFormatter; | |||
use Traversable; | |||
use Zend\I18n\Exception as I18nException; |
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.
No need to alias.
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.
Decouple I18n\View\Helper\AbstractTranslatorHelper from ext\intl
- s/Extensions/Extension/g - Added explanatory comments - Alias both exception types in DateTime validator
…fix/intl-optional Decouple I18n\View\Helper\AbstractTranslatorHelper from ext\intl
- s/Extensions/Extension/g - Added explanatory comments - Alias both exception types in DateTime validator
https://github.com/zendframework/zf2/blob/release-2.2.0rc1/library/Zend/I18n/View/Helper/AbstractTranslatorHelper.php#L34-L45
is too wide and involves also
https://github.com/zendframework/zf2/blob/release-2.2.0rc1/library/Zend/Form/View/Helper/AbstractHelper.php#L13
which has nothing to do with
ext\intl
apart forFormMonthSelect
and its descendantsWithout this fix, no
Form\View\Helper
can be used ifext\intl
is missing.I had to put some attribute initialization into constructors to avoid unmanagable fatal errors.