-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for the supportedLocalesOf() static methods (#16)
- Loading branch information
Showing
47 changed files
with
1,800 additions
and
129 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,18 @@ | ||
.. _ecma.intl.collator: | ||
|
||
==================== | ||
Ecma\\Intl\\Collator | ||
==================== | ||
|
||
.. php:namespace:: Ecma\Intl | ||
.. php:class:: Collator | ||
.. php:staticmethod:: supportedLocalesOf($locales[, $options = null]): string[] | ||
Returns an array of those locales provided that are supported by this | ||
implementation without having to fall back to the default locale. | ||
|
||
:param iterable<Stringable|string> | Stringable | string | null $locales: One | ||
or more language tags to check for support. | ||
:param Ecma\\Intl\\SupportedLocales\\Options $options: Options to use when | ||
evaluating supported locales. |
47 changes: 47 additions & 0 deletions
47
docs/readthedocs/reference/ecma-intl-supportedlocales-options.rst
This file contains 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,47 @@ | ||
.. _ecma.intl.supportedlocales.options: | ||
|
||
===================================== | ||
Ecma\\Intl\\SupportedLocales\\Options | ||
===================================== | ||
|
||
.. php:namespace:: Ecma\Intl\SupportedLocales | ||
.. php:class:: Options | ||
Options to use when evaluating supported locales. | ||
|
||
ECMA-402 defines a ``supportedLocalesOf()`` static method that is available | ||
on many of the classes provided in the specification. For example, see | ||
`Intl.Collator.supportedLocalesOf <https://tc39.es/ecma402/#sec-intl.collator.supportedlocalesof>`_. | ||
Each of these methods accepts an ``options`` object that specifies the | ||
locale matcher algorithm to use when evaluating supported locales. In this | ||
PHP implementation, :php:class:`Ecma\\Intl\\SupportedLocales\\Options` provides | ||
a type for this options object. | ||
|
||
.. php:attr:: localeMatcher: string | null, readonly | ||
The locale-matching algorithm to use when evaluating supported locales. | ||
|
||
.. php:method:: __construct([$localeMatcher = null]) | ||
:param Stringable | string | null $localeMatcher: The locale-matching | ||
algorithm to use when evaluating supported locales. This may be one | ||
of the values ``"best fit"`` or ``"lookup"``. Other implementations | ||
may define additional values. | ||
|
||
.. php:method:: jsonSerialize(): object | ||
Returns an object of these options, suitable for serializing to JSON. | ||
|
||
Please note that any options with a ``null`` value will not be included | ||
in the object this method returns. This allows the JSON to be passed to | ||
JavaScript contexts, where these properties are considered ``undefined``. | ||
|
||
.. php:method:: current(): string | bool | ||
.. php:method:: next(): void | ||
.. php:method:: key(): string | ||
.. php:method:: valid(): bool | ||
.. php:method:: rewind(): void |
This file contains 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 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
Oops, something went wrong.