Bug #74439 [Opn->Csd]: Wrong reflection on the Locale methods

From: Date: Mon, 17 Apr 2017 06:59:17 +0000
Subject: Bug #74439 [Opn->Csd]: Wrong reflection on the Locale methods
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208610@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74439&edit=1 ID: 74439 Updated by: krakjoe@php.net Reported by: fabien dot villepinte at gmail dot com Summary: Wrong reflection on the Locale methods -Status: Open +Status: Closed Type: Bug Package: I18N and L10N related PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Automatic comment on behalf of fabien.villepinte@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=7dc6b04f453d0111447a3bcd1f3e88a5c32c2a22 Log: Fixed bug #74439 Wrong reflection on the Locale methods Previous Comments: ------------------------------------------------------------------------ [2017-04-14 12:06:32] fabien dot villepinte at gmail dot com Description: ------------ All optional parameters of the Locale class are described as required by reflection. Test script: --------------- <?php $methods = [ 'getDefault', 'acceptFromHttp', 'canonicalize', 'composeLocale', 'getAllVariants', 'getKeywords', 'getPrimaryLanguage', 'getRegion', 'getScript', 'parseLocale', 'setDefault', 'getDisplayLanguage', 'getDisplayName', 'getDisplayRegion', 'getDisplayScript', 'getDisplayVariant', 'filterMatches', 'lookup', ]; foreach ($methods as $method) { $rm = new ReflectionMethod(Locale::class, $method); printf("%s: %d, %d\n", $method, $rm->getNumberOfParameters(), $rm->getNumberOfRequiredParameters()); } Expected result: ---------------- getDefault: 0, 0 acceptFromHttp: 1, 1 canonicalize: 1, 1 composeLocale: 1, 1 getAllVariants: 1, 1 getKeywords: 1, 1 getPrimaryLanguage: 1, 1 getRegion: 1, 1 getScript: 1, 1 parseLocale: 1, 1 setDefault: 1, 1 getDisplayLanguage: 2, 1 getDisplayName: 2, 1 getDisplayRegion: 2, 1 getDisplayScript: 2, 1 getDisplayVariant: 2, 1 filterMatches: 3, 2 lookup: 4, 2 Actual result: -------------- getDefault: 0, 0 acceptFromHttp: 1, 1 canonicalize: 1, 1 composeLocale: 1, 1 getAllVariants: 1, 1 getKeywords: 1, 1 getPrimaryLanguage: 1, 1 getRegion: 1, 1 getScript: 1, 1 parseLocale: 1, 1 setDefault: 1, 1 getDisplayLanguage: 2, 2 getDisplayName: 2, 2 getDisplayRegion: 2, 2 getDisplayScript: 2, 2 getDisplayVariant: 2, 2 filterMatches: 3, 3 lookup: 4, 4 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74439&edit=1

« previous php.bugs (#208610) next »