From 0f022c711d3cd838d342b52427ad17019212ca4e Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Wed, 4 Nov 2020 11:02:34 -0500 Subject: [PATCH] Remove use of PHP 7.2 function --- dictionaries/CallMap_72_delta.php | 2 +- .../Statements/Expression/Call/ArgumentAnalyzer.php | 6 +----- src/Psalm/Internal/Codebase/Functions.php | 3 ++- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/dictionaries/CallMap_72_delta.php b/dictionaries/CallMap_72_delta.php index c555bb332..4e314764a 100644 --- a/dictionaries/CallMap_72_delta.php +++ b/dictionaries/CallMap_72_delta.php @@ -35,7 +35,7 @@ return [ 'ldap_exop_whoami' => ['string', 'link'=>'resource'], 'ldap_parse_exop' => ['bool', 'link'=>'resource', 'result'=>'resource', 'retdata='=>'string', 'retoid='=>'string'], 'mb_chr' => ['string', 'cp'=>'int', 'encoding='=>'string'], - 'mb_ord' => ['int', 'str'=>'string', 'enc='=>'string'], + 'mb_ord' => ['int|false', 'str'=>'string', 'enc='=>'string'], 'mb_scrub' => ['string', 'str'=>'string', 'enc='=>'string'], 'oci_register_taf_callback' => ['bool', 'connection'=>'resource', 'callback='=>'callable'], 'oci_unregister_taf_callback' => ['bool', 'connection'=>'resource'], diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php index 55d0bd69d..db6796081 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php @@ -137,11 +137,7 @@ class ArgumentAnalyzer $gt_count = 0; foreach ($values as $value) { - /** - * @var int - * @psalm-suppress UnnecessaryVarAnnotation - */ - $ord = \mb_ord($value); + $ord = ord($value); if ($ord > $prev_ord) { $gt_count++; diff --git a/src/Psalm/Internal/Codebase/Functions.php b/src/Psalm/Internal/Codebase/Functions.php index a8802dfeb..e32572e13 100644 --- a/src/Psalm/Internal/Codebase/Functions.php +++ b/src/Psalm/Internal/Codebase/Functions.php @@ -6,6 +6,7 @@ use function explode; use function implode; use Psalm\Codebase; use Psalm\Internal\Analyzer\StatementsAnalyzer; +use Psalm\Internal\Codebase\InternalCallMapHandler; use Psalm\Internal\Provider\FileStorageProvider; use Psalm\Internal\Provider\FunctionExistenceProvider; use Psalm\Internal\Provider\FunctionParamsProvider; @@ -419,7 +420,7 @@ class Functions } } - $function_callable = \Psalm\Internal\Codebase\InternalCallMapHandler::getCallableFromCallMapById( + $function_callable = InternalCallMapHandler::getCallableFromCallMapById( $codebase, $function_id, $args ?: [],