Hi David,
I tried this as an experimental feature. The implementation is way more
smoother than I
expected. As the numberFormatter class in PHP side is somehow very suitable for
this.
The proposed constructor is now:
public function __construct(
?string $locale = null,
int $style = self::STYLE_LONG,
int $capitalizationContext = self::CAPITALIZATION_NONE,
?NumberFormatter $numberFormatter = null,
) {}
Also, considering enums and namespaces. Tim raised this suggestion to me
before. So I'd
like to put this in the future scope of this RFC. A broader ext/intl
modernization RFC could
revisit namespaces and PHP enums consistently across intl classes. This is not
we are
supposed to do in this specific RFC imho. However, the idea is reasonable.
Thanks for the feedback!
Cheers,
Weilin