From 00663ef6a45b1f1c4d2c9eea93ea805a9aaf786e Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 9 Nov 2021 09:22:03 +0100 Subject: [PATCH 1/2] Use positive integers for various time functions --- resources/functionMap.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/functionMap.php b/resources/functionMap.php index 51a7c99426..b898c2b20f 100644 --- a/resources/functionMap.php +++ b/resources/functionMap.php @@ -10250,7 +10250,7 @@ 'sin' => ['float', 'number'=>'float'], 'sinh' => ['float', 'number'=>'float'], 'sizeof' => ['int', 'var'=>'Countable|array', 'mode='=>'int'], -'sleep' => ['int|false', 'seconds'=>'int'], +'sleep' => ['int|false', 'seconds'=>'positive-int'], 'snmp2_get' => ['string|false', 'host'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'], 'snmp2_getnext' => ['string|false', 'host'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'], 'snmp2_real_walk' => ['array|false', 'host'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'], @@ -12305,8 +12305,8 @@ 'tidyNode::isJste' => ['bool'], 'tidyNode::isPhp' => ['bool'], 'tidyNode::isText' => ['bool'], -'time' => ['int'], -'time_nanosleep' => ['array{0:int,1:int}|bool', 'seconds'=>'int', 'nanoseconds'=>'int'], +'time' => ['positive-int'], +'time_nanosleep' => ['array{0:0|positive-int,1:0|positive-int}|bool', 'seconds'=>'positive-int', 'nanoseconds'=>'positive-int'], 'time_sleep_until' => ['bool', 'timestamp'=>'float'], 'timezone_abbreviations_list' => ['array'], 'timezone_identifiers_list' => ['array', 'what='=>'int', 'country='=>'?string'], @@ -12694,7 +12694,7 @@ 'urldecode' => ['string', 'str'=>'string'], 'urlencode' => ['string', 'str'=>'string'], 'use_soap_error_handler' => ['bool', 'handler='=>'bool'], -'usleep' => ['void', 'micro_seconds'=>'int'], +'usleep' => ['void', 'micro_seconds'=>'positive-int'], 'usort' => ['bool', '&rw_array_arg'=>'array', 'callback'=>'callable(mixed,mixed):int'], 'utf8_decode' => ['string', 'data'=>'string'], 'utf8_encode' => ['string', 'data'=>'string'], From 5d268796468deacbde62e6efb9e2ebe34205099f Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 9 Nov 2021 10:49:49 +0100 Subject: [PATCH 2/2] Update functionMap.php --- resources/functionMap.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/functionMap.php b/resources/functionMap.php index b898c2b20f..57ab6c1bfc 100644 --- a/resources/functionMap.php +++ b/resources/functionMap.php @@ -10250,7 +10250,7 @@ 'sin' => ['float', 'number'=>'float'], 'sinh' => ['float', 'number'=>'float'], 'sizeof' => ['int', 'var'=>'Countable|array', 'mode='=>'int'], -'sleep' => ['int|false', 'seconds'=>'positive-int'], +'sleep' => ['int|false', 'seconds'=>'int'], 'snmp2_get' => ['string|false', 'host'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'], 'snmp2_getnext' => ['string|false', 'host'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'], 'snmp2_real_walk' => ['array|false', 'host'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'], @@ -12306,7 +12306,7 @@ 'tidyNode::isPhp' => ['bool'], 'tidyNode::isText' => ['bool'], 'time' => ['positive-int'], -'time_nanosleep' => ['array{0:0|positive-int,1:0|positive-int}|bool', 'seconds'=>'positive-int', 'nanoseconds'=>'positive-int'], +'time_nanosleep' => ['array{0:0|positive-int,1:0|positive-int}|bool', 'seconds'=>'int', 'nanoseconds'=>'int'], 'time_sleep_until' => ['bool', 'timestamp'=>'float'], 'timezone_abbreviations_list' => ['array'], 'timezone_identifiers_list' => ['array', 'what='=>'int', 'country='=>'?string'], @@ -12694,7 +12694,7 @@ 'urldecode' => ['string', 'str'=>'string'], 'urlencode' => ['string', 'str'=>'string'], 'use_soap_error_handler' => ['bool', 'handler='=>'bool'], -'usleep' => ['void', 'micro_seconds'=>'positive-int'], +'usleep' => ['void', 'micro_seconds'=>'int'], 'usort' => ['bool', '&rw_array_arg'=>'array', 'callback'=>'callable(mixed,mixed):int'], 'utf8_decode' => ['string', 'data'=>'string'], 'utf8_encode' => ['string', 'data'=>'string'],