From c7f3a3c44584d205c24ce15a55949f2abf60cb92 Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Tue, 6 Feb 2018 20:46:22 -0800 Subject: [PATCH] Make types in the call map more specific (#496) fix a few incorrect types. --- src/Psalm/CallMap.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Psalm/CallMap.php b/src/Psalm/CallMap.php index eae506274..019febb68 100644 --- a/src/Psalm/CallMap.php +++ b/src/Psalm/CallMap.php @@ -7161,7 +7161,7 @@ return [ 'preg_match_all' => ['int|false', 'pattern'=>'string', 'subject'=>'string', '&w_subpatterns='=>'array', 'flags='=>'int', 'offset='=>'int'], 'preg_match' => ['int|false', 'pattern'=>'string', 'subject'=>'string', '&w_subpatterns='=>'array', 'flags='=>'int', 'offset='=>'int'], 'preg_quote' => ['string', 'str'=>'string', 'delim_char='=>'string'], -'preg_replace_callback_array' => ['string|array', 'pattern'=>'callable[]', 'subject'=>'string|array', 'limit='=>'int', '&w_count='=>'int'], +'preg_replace_callback_array' => ['string|array', 'pattern'=>'array', 'subject'=>'string|array', 'limit='=>'int', '&w_count='=>'int'], 'preg_replace_callback' => ['string|array|null', 'regex'=>'string|array', 'callback'=>'callable', 'subject'=>'string|array', 'limit='=>'int', '&w_count='=>'int'], 'preg_replace' => ['string|array|null', 'regex'=>'string|array', 'replace'=>'string|array', 'subject'=>'string|array', 'limit='=>'int', '&w_count='=>'int'], 'preg_split' => ['array', 'pattern'=>'string', 'subject'=>'string', 'limit='=>'?int', 'flags='=>'int'], @@ -7496,7 +7496,7 @@ return [ 'RecursiveTreeIterator::beginIteration' => ['RecursiveIterator'], 'RecursiveTreeIterator::callGetChildren' => ['RecursiveIterator'], 'RecursiveTreeIterator::callHasChildren' => ['bool'], -'RecursiveTreeIterator::__construct' => ['void', 'it'=>'recursiveiterator|iteratoraggregate', 'flags'=>'int', 'cit_flags'=>'int', ']]]'=>'mode'], +'RecursiveTreeIterator::__construct' => ['void', 'it'=>'recursiveiterator|iteratoraggregate', 'flags'=>'int', 'cit_flags'=>'int', 'mode'=>'int'], 'RecursiveTreeIterator::current' => ['string'], 'RecursiveTreeIterator::endChildren' => ['void'], 'RecursiveTreeIterator::endIteration' => ['void'], @@ -7535,7 +7535,7 @@ return [ 'Redis::flushAll' => ['bool'], 'Redis::flushDb' => ['bool'], 'Redis::getBit' => ['int', 'key'=>'string', 'offset'=>'int'], -'Redis::getKeys' => ['string[]', 'pattern'=>'string'], +'Redis::getKeys' => ['array', 'pattern'=>'string'], 'Redis::getMultiple' => ['array', 'keys'=>'string[]'], 'Redis::getOption' => ['', 'name'=>'int'], 'Redis::getRange' => ['int', 'key'=>'string', 'start'=>'int', 'end'=>'int'], @@ -7545,7 +7545,7 @@ return [ 'Redis::incrBy' => ['int', 'key'=>'string', 'value'=>'int'], 'Redis::incr' => ['int', 'key'=>'string'], 'Redis::info' => ['array', 'option='=>'string'], -'Redis::keys' => ['string[]', 'pattern'=>'string'], +'Redis::keys' => ['array', 'pattern'=>'string'], 'Redis::lastSave' => ['int'], 'Redis::mGet' => ['array', 'keys'=>'string[]'], 'Redis::migrate' => ['', 'host'=>'string', 'port'=>'int', 'db'=>'int', 'timeout'=>'int', 'copy='=>'bool', 'replace='=>'bool'], @@ -7567,7 +7567,7 @@ return [ 'Redis::resetStat' => ['bool'], 'Redis::restore' => ['', 'key'=>'string', 'ttl'=>'int', 'value'=>'string'], 'Redis::save' => ['bool'], -'Redis::scan' => ['string[]|false', '&rw_iterator'=>'?int', 'pattern='=>'?string', 'count='=>'?int'], +'Redis::scan' => ['array|false', '&rw_iterator'=>'?int', 'pattern='=>'?string', 'count='=>'?int'], 'Redis::select' => ['bool', 'dbindex'=>'int'], 'Redis::setBit' => ['int', 'key'=>'string', 'offset'=>'int', 'value'=>'int'], 'Redis::set' => ['bool', 'key'=>'string', 'value'=>'string', 'options='=>'array'], @@ -7578,7 +7578,7 @@ return [ 'Redis::setRange' => ['int', 'key'=>'string', 'offset'=>'int', 'end'=>'int'], 'Redis::slave\'1' => ['bool', 'host'=>'string', 'port'=>'int'], 'Redis::slave' => ['bool', 'host'=>'string', 'port'=>'int'], -'Redis::slowLog' => ['', 'operation'=>'string', 'length='=>'int'], +'Redis::slowLog' => ['mixed', 'operation'=>'string', 'length='=>'int'], 'Redis::sort' => ['array|int', 'options='=>'?array'], 'Redis::strLen' => ['int', 'key'=>'string'], 'Redis::time' => ['array'], @@ -7588,7 +7588,7 @@ return [ 'ReflectionClass::__construct' => ['void', 'argument'=>''], 'ReflectionClass::export' => ['?string', 'argument'=>'string|object', 'return='=>'bool'], 'ReflectionClass::getConstant' => ['mixed', 'name'=>'string'], -'ReflectionClass::getConstants' => ['array'], +'ReflectionClass::getConstants' => ['array'], 'ReflectionClass::getConstructor' => ['ReflectionMethod'], 'ReflectionClass::getDefaultProperties' => ['array'], 'ReflectionClass::getDocComment' => ['string|false'], @@ -7610,9 +7610,9 @@ return [ 'ReflectionClass::getStartLine' => ['int'], 'ReflectionClass::getStaticProperties' => ['array'], 'ReflectionClass::getStaticPropertyValue' => ['mixed', 'name'=>'string', 'default='=>'mixed'], -'ReflectionClass::getTraitAliases' => ['string[]'], -'ReflectionClass::getTraitNames' => ['string[]'], -'ReflectionClass::getTraits' => ['ReflectionClass[]'], +'ReflectionClass::getTraitAliases' => ['array'], +'ReflectionClass::getTraitNames' => ['array'], +'ReflectionClass::getTraits' => ['array'], 'ReflectionClass::hasConstant' => ['bool', 'name'=>'string'], 'ReflectionClass::hasMethod' => ['bool', 'name'=>'string'], 'ReflectionClass::hasProperty' => ['bool', 'name'=>'string'], @@ -7641,7 +7641,7 @@ return [ 'ReflectionExtension::export' => ['?string', 'name'=>'string', 'return='=>'bool'], 'ReflectionExtension::getClasses' => ['array'], 'ReflectionExtension::getClassNames' => ['array'], -'ReflectionExtension::getConstants' => ['array'], +'ReflectionExtension::getConstants' => ['array'], 'ReflectionExtension::getDependencies' => ['array'], 'ReflectionExtension::getFunctions' => ['array'], 'ReflectionExtension::getINIEntries' => ['array'], @@ -7663,7 +7663,7 @@ return [ 'ReflectionFunctionAbstract::getName' => ['string'], 'ReflectionFunctionAbstract::getNumberOfParameters' => ['int'], 'ReflectionFunctionAbstract::getNumberOfRequiredParameters' => ['int'], -'ReflectionFunctionAbstract::getParameters' => ['ReflectionParameter[]'], +'ReflectionFunctionAbstract::getParameters' => ['array'], 'ReflectionFunctionAbstract::getReturnType' => ['?ReflectionType'], 'ReflectionFunctionAbstract::getShortName' => ['string'], 'ReflectionFunctionAbstract::getStartLine' => ['int'], @@ -7692,7 +7692,7 @@ return [ 'ReflectionFunction::getName' => ['string'], 'ReflectionFunction::getNumberOfParameters' => ['int'], 'ReflectionFunction::getNumberOfRequiredParameters' => ['int'], -'ReflectionFunction::getParameters' => ['ReflectionParameter[]'], +'ReflectionFunction::getParameters' => ['array'], 'ReflectionFunction::getReturnType' => ['?ReflectionType'], 'ReflectionFunction::getShortName' => ['string'], 'ReflectionFunction::getStartLine' => ['int'], @@ -7919,7 +7919,7 @@ return [ 'SCA::createDataObject' => ['SDO_DataObject', 'type_namespace_uri'=>'string', 'type_name'=>'string'], 'SCA::getService' => ['', 'target'=>'string', 'binding='=>'string', 'config='=>'array'], 'SCA_LocalProxy::createDataObject' => ['SDO_DataObject', 'type_namespace_uri'=>'string', 'type_name'=>'string'], -'scandir' => ['string[]|false', 'dir'=>'string', 'sorting_order='=>'int', 'context='=>'resource'], +'scandir' => ['array|false', 'dir'=>'string', 'sorting_order='=>'int', 'context='=>'resource'], 'SCA_SoapProxy::createDataObject' => ['SDO_DataObject', 'type_namespace_uri'=>'string', 'type_name'=>'string'], 'SDO_DAS_ChangeSummary::beginLogging' => [''], 'SDO_DAS_ChangeSummary::endLogging' => [''], @@ -9186,7 +9186,7 @@ return [ 'str_rot13' => ['string', 'str'=>'string'], 'strrpos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int'], 'str_shuffle' => ['string', 'str'=>'string'], -'str_split' => ['string[]', 'str'=>'string', 'split_length='=>'int'], +'str_split' => ['array', 'str'=>'string', 'split_length='=>'int'], 'strspn' => ['int', 'str'=>'string', 'mask'=>'string', 'start='=>'int', 'len='=>'int'], 'strstr' => ['string|false', 'haystack'=>'string', 'needle'=>'mixed', 'part='=>'bool'], 'strtok\'1' => ['string|false', 'token'=>'string'], @@ -10659,7 +10659,7 @@ return [ 'Yar_Client::__call' => ['void', 'method'=>'string', 'parameters'=>'array'], 'Yar_Client::__construct' => ['void', 'url'=>'string'], 'Yar_Client_Exception::getType' => ['void'], -'Yar_Client::setOpt' => ['bool', 'name'=>'numeric', 'value'=>'mixed'], +'Yar_Client::setOpt' => ['bool', 'name'=>'int', 'value'=>'mixed'], 'Yar_Concurrent_Client::call' => ['int', 'uri'=>'string', 'method'=>'string', 'parameters'=>'array', 'callback='=>'callable'], 'Yar_Concurrent_Client::loop' => ['bool', 'callback='=>'callable', 'error_callback='=>'callable'], 'Yar_Server::__construct' => ['void', 'obj'=>'Object'],