rfc:intldatetimepatterngenerator

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:intldatetimepatterngenerator [2021/04/30 16:23] – Missing bracket deltragonrfc:intldatetimepatterngenerator [2021/06/10 11:48] (current) nikic
Line 3: Line 3:
   * Date: 2021-04-24   * Date: 2021-04-24
   * Author: Mel Dafert, mel@dafert.at   * Author: Mel Dafert, mel@dafert.at
-  * Status: Under Discussion+  * Status: Implemented
   * Implementation: https://github.com/php/php-src/pull/6771   * Implementation: https://github.com/php/php-src/pull/6771
   * First Published at: http://wiki.php.net/rfc/intldatetimepatterngenerator   * First Published at: http://wiki.php.net/rfc/intldatetimepatterngenerator
 +  * Target Version: PHP 8.1
  
 ===== Introduction ===== ===== Introduction =====
Line 32: Line 33:
     public function getBestPattern(string $skeleton): string|false {}     public function getBestPattern(string $skeleton): string|false {}
 } }
 +
 +// Procedural style:
 +function datepatterngenerator_create(?string $locale = null): ?IntlDatePatternGenerator {}
 +
 +function datepatterngenerator_get_best_pattern(IntlDatePatternGenerator $patternGenerator, string $skeleton): string|false {}
 </code> </code>
  
Line 76: Line 82:
 ===== Proposed PHP Version(s) ===== ===== Proposed PHP Version(s) =====
 8.1 8.1
- 
-===== Open Issues ===== 
- 
-==== Constructor ==== 
-Like ''IntlDateFormatter'', this provides both a ''<nowiki>__construct</nowiki>'' method and an equivalent static ''create'' method. 
-Other classes inside the intl extension (like ''IntlCalendar'') only provide a static ''create'' method, and leave the ''<nowiki>__</nowiki>construct'' method private. Is there a preferred way, or are both equivalent? 
  
 ===== Future Scope ===== ===== Future Scope =====
 The ICU ''DateTimePatternGenerator'' class provides some additional methods (for example ''getSkeleton'' to reduce a given pattern to its skeleton form). These other methodes are of limited use compared to ''getBestPattern'', and have been omitted in this RFC. The ICU ''DateTimePatternGenerator'' class provides some additional methods (for example ''getSkeleton'' to reduce a given pattern to its skeleton form). These other methodes are of limited use compared to ''getBestPattern'', and have been omitted in this RFC.
  
-===== Proposed Voting Choices ===== +===== Vote ===== 
-Yes/No, requiring a 2/3 majority.+Yes/No, requiring a 2/3 majority. Voting started on 2021-05-14 16:00 UTC and ends 2021-05-28 16:00 UTC. 
 +<doodle title="Add IntlDatePatternGenerator?" auth="deltragon" voteType="single" closed="true"> 
 +   * Yes 
 +   * No 
 +</doodle>
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
rfc/intldatetimepatterngenerator.1619799818.txt.gz · Last modified: 2021/04/30 16:23 by deltragon