Skip to content

Commit

Permalink
Merge pull request #7159 from AndrolGenhald/bugfix/number-format-opti…
Browse files Browse the repository at this point in the history
…onal-arguments

Fix optional arguments in number_format (fixes #7158).
  • Loading branch information
orklah committed Dec 14, 2021
2 parents 5ddf5df + 10b6b9a commit 41fe553
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 1 addition & 2 deletions dictionaries/CallMap.php
Expand Up @@ -9025,8 +9025,7 @@
'nsapi_response_headers' => ['array'],
'nsapi_virtual' => ['bool', 'uri'=>'string'],
'nthmac' => ['string', 'clent'=>'string', 'data'=>'string'],
'number_format' => ['string', 'num'=>'float|int', 'decimals='=>'int'],
'number_format\'1' => ['string', 'num'=>'float|int', 'decimals'=>'int', 'decimal_separator'=>'string', 'thousands_separator'=>'string'],
'number_format' => ['string', 'num'=>'float|int', 'decimals='=>'int', 'decimal_separator='=>'string', 'thousands_separator='=>'string'],
'NumberFormatter::__construct' => ['void', 'locale'=>'string', 'style'=>'int', 'pattern='=>'string'],
'NumberFormatter::create' => ['NumberFormatter|false', 'locale'=>'string', 'style'=>'int', 'pattern='=>'string'],
'NumberFormatter::format' => ['string|false', 'num'=>'', 'type='=>'int'],
Expand Down
5 changes: 5 additions & 0 deletions dictionaries/CallMap_80_delta.php
Expand Up @@ -949,6 +949,10 @@
'old' => ['bool', 'mysql'=>'mysqli', 'flags='=>'int', 'name='=>'string'],
'new' => ['bool', 'mysql'=>'mysqli', 'flags='=>'int', 'name='=>'?string'],
],
'number_format' => [
'old' => ['string', 'num'=>'float|int', 'decimals='=>'int'],
'new' => ['string', 'num'=>'float|int', 'decimals='=>'int', 'decimal_separator='=>'string', 'thousands_separator='=>'string'],
],
'openssl_csr_export' => [
'old' => ['bool', 'csr'=>'string|resource', '&w_output'=>'string', 'no_text='=>'bool'],
'new' => ['bool', 'csr'=>'OpenSSLCertificateSigningRequest|string', '&w_output'=>'OpenSSLAsymmetricKey', 'no_text='=>'bool'],
Expand Down Expand Up @@ -1591,6 +1595,7 @@
'image2wbmp' => ['bool', 'im'=>'resource', 'filename='=>'?string', 'threshold='=>'int'],
'jpeg2wbmp' => ['bool', 'jpegname'=>'string', 'wbmpname'=>'string', 'dest_height'=>'int', 'dest_width'=>'int', 'threshold'=>'int'],
'ldap_sort' => ['bool', 'link_identifier'=>'resource', 'result_identifier'=>'resource', 'sortfilter'=>'string'],
'number_format\'1' => ['string', 'num'=>'float|int', 'decimals'=>'int', 'decimal_separator'=>'string', 'thousands_separator'=>'string'],
'png2wbmp' => ['bool', 'pngname'=>'string', 'wbmpname'=>'string', 'dest_height'=>'int', 'dest_width'=>'int', 'threshold'=>'int'],
'read_exif_data' => ['array', 'filename'=>'string', 'sections_needed='=>'string', 'sub_arrays='=>'bool', 'read_thumbnail='=>'bool'],
'SimpleXMLIterator::rewind' => ['void'],
Expand Down
8 changes: 8 additions & 0 deletions tests/FunctionCallTest.php
Expand Up @@ -1763,6 +1763,14 @@ function sayHello(string $needle): void {
[],
'8.1',
],
'number_formatNamedArgument' => [
'<?php
echo number_format(10.363, 1, thousands_separator: " ");
',
[],
[],
'8.0',
],
];
}

Expand Down

0 comments on commit 41fe553

Please sign in to comment.