diff --git a/dictionaries/CallMap.php b/dictionaries/CallMap.php index 8ceb5e0b59d..cf359e7f006 100644 --- a/dictionaries/CallMap.php +++ b/dictionaries/CallMap.php @@ -1543,7 +1543,7 @@ 'Couchbase\WildcardSearchQuery::jsonSerialize' => ['array'], 'Couchbase\zlibCompress' => ['string', 'data'=>'string'], 'Couchbase\zlibDecompress' => ['string', 'data'=>'string'], -'count' => ['int', 'value'=>'Countable|array', 'mode='=>'int'], +'count' => ['int<0, max>', 'value'=>'Countable|array', 'mode='=>'int'], 'count_chars' => ['array', 'input'=>'string', 'mode='=>'0|1|2'], 'count_chars\'1' => ['string', 'input'=>'string', 'mode='=>'3|4'], 'Countable::count' => ['int'], diff --git a/dictionaries/CallMap_80_delta.php b/dictionaries/CallMap_80_delta.php index 4afa6e75d06..e3988c0f337 100644 --- a/dictionaries/CallMap_80_delta.php +++ b/dictionaries/CallMap_80_delta.php @@ -306,8 +306,8 @@ 'new' => ['bool', 'typelib_name'=>'string', 'case_insensitive='=>'true'], ], 'count' => [ - 'old' => ['int', 'value'=>'Countable|array|SimpleXMLElement', 'mode='=>'int'], - 'new' => ['int', 'value'=>'Countable|array', 'mode='=>'int'], + 'old' => ['int<0, max>', 'value'=>'Countable|array|SimpleXMLElement', 'mode='=>'int'], + 'new' => ['int<0, max>', 'value'=>'Countable|array', 'mode='=>'int'], ], 'count_chars' => [ 'old' => ['array|false', 'input'=>'string', 'mode='=>'0|1|2'], diff --git a/dictionaries/CallMap_historical.php b/dictionaries/CallMap_historical.php index 314d4859f1e..44a023c1cef 100644 --- a/dictionaries/CallMap_historical.php +++ b/dictionaries/CallMap_historical.php @@ -10084,7 +10084,7 @@ 'copy' => ['bool', 'from'=>'string', 'to'=>'string', 'context='=>'resource'], 'cos' => ['float', 'num'=>'float'], 'cosh' => ['float', 'num'=>'float'], - 'count' => ['int', 'value'=>'Countable|array|SimpleXMLElement', 'mode='=>'int'], + 'count' => ['int<0, max>', 'value'=>'Countable|array|SimpleXMLElement', 'mode='=>'int'], 'count_chars' => ['array|false', 'input'=>'string', 'mode='=>'0|1|2'], 'count_chars\'1' => ['string|false', 'input'=>'string', 'mode='=>'3|4'], 'crack_check' => ['bool', 'dictionary'=>'', 'password'=>'string'], diff --git a/tests/FunctionCallTest.php b/tests/FunctionCallTest.php index 837e7111301..44bcd62a41e 100644 --- a/tests/FunctionCallTest.php +++ b/tests/FunctionCallTest.php @@ -1220,6 +1220,13 @@ function example(callable $x) : int { return count($x); }', ], + 'countOnObjectShouldBePositive' => [ + 'code' => ' [ 'code' => ' 'TypeDoesNotContainType', ], - 'countOnObjectCannotBePositive' => [ - 'code' => ' 'LessSpecificReturnStatement', - ], 'countOnUnknownObjectCannotBePure' => [ 'code' => '