Skip to content

Commit

Permalink
Fix implode() with named arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed May 17, 2021
1 parent 84ea0e1 commit 18f8473
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions resources/functionMap_php80delta.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
'imagejpeg\'1' => ['string|false', 'im'=>'resource', 'filename='=>'null', 'quality='=>'int'],
'imagerotate' => ['resource|false', 'src_im'=>'resource', 'angle'=>'float', 'bgdcolor'=>'int', 'ignoretransparent='=>'int'],
'imagescale' => ['resource|false', 'im'=>'resource', 'new_width'=>'int', 'new_height='=>'int', 'method='=>'int'],
'implode\'1' => ['string', 'pieces'=>'array'],
'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'],
'mb_decode_numericentity' => ['string|false', 'string'=>'string', 'convmap'=>'array', 'encoding='=>'string', 'is_hex='=>'bool'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,14 @@ public function testImplodeOnPhp74(): void
if (PHP_VERSION_ID < 70400) {
$errors = [];
}
if (PHP_VERSION_ID >= 80000) {
$errors = [
[
'Parameter #2 $array of function implode expects array, string given.',
8,
],
];
}

$this->analyse([__DIR__ . '/data/implode-74.php'], $errors);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php declare(strict_types = 1); // lint >= 8.0

\number_format(200.00, decimals: 2, decimal_separator: ',', thousands_separator: '&nbsp;');

$name = implode(separator: ' ', array: ['John', 'Doe']);

0 comments on commit 18f8473

Please sign in to comment.