From ce7b78cf8fc803d99d285e64a4233ef6843f818c Mon Sep 17 00:00:00 2001 From: kkmuffme <11071985+kkmuffme@users.noreply.github.com> Date: Wed, 5 Jul 2023 16:23:36 +0200 Subject: [PATCH 1/4] offsetExists/Get/Set/Unset types were too generic since only array key types + null lead to expected results --- dictionaries/CallMap.php | 96 ++++++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/dictionaries/CallMap.php b/dictionaries/CallMap.php index 0f17d1917..4145bf41e 100644 --- a/dictionaries/CallMap.php +++ b/dictionaries/CallMap.php @@ -425,10 +425,10 @@ return [ 'array_walk\'1' => ['bool', '&rw_array'=>'object', 'callback'=>'callable', 'arg='=>'mixed'], 'array_walk_recursive' => ['bool', '&rw_array'=>'array', 'callback'=>'callable', 'arg='=>'mixed'], 'array_walk_recursive\'1' => ['bool', '&rw_array'=>'object', 'callback'=>'callable', 'arg='=>'mixed'], -'ArrayAccess::offsetExists' => ['bool', 'offset'=>'mixed'], -'ArrayAccess::offsetGet' => ['mixed', 'offset'=>'mixed'], -'ArrayAccess::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'], -'ArrayAccess::offsetUnset' => ['void', 'offset'=>'mixed'], +'ArrayAccess::offsetExists' => ['bool', 'offset'=>'int|string'], +'ArrayAccess::offsetGet' => ['mixed', 'offset'=>'int|string'], +'ArrayAccess::offsetSet' => ['void', 'offset'=>'int|string|null', 'value'=>'mixed'], +'ArrayAccess::offsetUnset' => ['void', 'offset'=>'int|string'], 'ArrayIterator::__construct' => ['void', 'array='=>'array|object', 'flags='=>'int'], 'ArrayIterator::append' => ['void', 'value'=>'mixed'], 'ArrayIterator::asort' => ['true', 'flags='=>'int'], @@ -443,7 +443,7 @@ return [ 'ArrayIterator::next' => ['void'], 'ArrayIterator::offsetExists' => ['bool', 'key'=>'string|int'], 'ArrayIterator::offsetGet' => ['mixed', 'key'=>'string|int'], -'ArrayIterator::offsetSet' => ['void', 'key'=>'string|int', 'value'=>'mixed'], +'ArrayIterator::offsetSet' => ['void', 'key'=>'string|int|null', 'value'=>'mixed'], 'ArrayIterator::offsetUnset' => ['void', 'key'=>'string|int'], 'ArrayIterator::rewind' => ['void'], 'ArrayIterator::seek' => ['void', 'offset'=>'int'], @@ -467,7 +467,7 @@ return [ 'ArrayObject::natsort' => ['true'], 'ArrayObject::offsetExists' => ['bool', 'key'=>'int|string'], 'ArrayObject::offsetGet' => ['mixed|null', 'key'=>'int|string'], -'ArrayObject::offsetSet' => ['void', 'key'=>'int|string', 'value'=>'mixed'], +'ArrayObject::offsetSet' => ['void', 'key'=>'int|string|null', 'value'=>'mixed'], 'ArrayObject::offsetUnset' => ['void', 'key'=>'int|string'], 'ArrayObject::serialize' => ['string'], 'ArrayObject::setFlags' => ['void', 'flags'=>'int'], @@ -4348,10 +4348,10 @@ return [ 'http\Message\Parser::stream' => ['int', 'stream'=>'resource', 'flags'=>'int', '&message'=>'http\Message'], 'http\Params::__construct' => ['void', 'params='=>'mixed', 'param_sep='=>'mixed', 'arg_sep='=>'mixed', 'val_sep='=>'mixed', 'flags='=>'mixed'], 'http\Params::__toString' => ['string'], -'http\Params::offsetExists' => ['bool', 'name'=>'mixed'], -'http\Params::offsetGet' => ['mixed', 'name'=>'mixed'], -'http\Params::offsetSet' => ['void', 'name'=>'mixed', 'value'=>'mixed'], -'http\Params::offsetUnset' => ['void', 'name'=>'mixed'], +'http\Params::offsetExists' => ['bool', 'name'=>'int|string'], +'http\Params::offsetGet' => ['mixed', 'name'=>'int|string'], +'http\Params::offsetSet' => ['void', 'name'=>'int|string|null', 'value'=>'mixed'], +'http\Params::offsetUnset' => ['void', 'name'=>'int|string'], 'http\Params::toArray' => ['array'], 'http\Params::toString' => ['string'], 'http\QueryString::__construct' => ['void', 'querystring'=>'string'], @@ -4366,10 +4366,10 @@ return [ 'http\QueryString::getObject' => ['object|mixed', 'name'=>'string', 'defval='=>'mixed', 'delete='=>'bool|false'], 'http\QueryString::getString' => ['string|mixed', 'name'=>'string', 'defval='=>'mixed', 'delete='=>'bool|false'], 'http\QueryString::mod' => ['http\QueryString', 'params='=>'mixed'], -'http\QueryString::offsetExists' => ['bool', 'offset'=>'mixed'], -'http\QueryString::offsetGet' => ['mixed|null', 'offset'=>'mixed'], -'http\QueryString::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'], -'http\QueryString::offsetUnset' => ['void', 'offset'=>'mixed'], +'http\QueryString::offsetExists' => ['bool', 'offset'=>'int|string'], +'http\QueryString::offsetGet' => ['mixed|null', 'offset'=>'int|string'], +'http\QueryString::offsetSet' => ['void', 'offset'=>'int|string|null', 'value'=>'mixed'], +'http\QueryString::offsetUnset' => ['void', 'offset'=>'int|string'], 'http\QueryString::serialize' => ['string'], 'http\QueryString::set' => ['http\QueryString', 'params'=>'mixed'], 'http\QueryString::toArray' => ['array'], @@ -4493,10 +4493,10 @@ return [ 'HttpQueryString::getObject' => ['', 'name'=>'', 'defval'=>'', 'delete'=>''], 'HttpQueryString::getString' => ['', 'name'=>'', 'defval'=>'', 'delete'=>''], 'HttpQueryString::mod' => ['HttpQueryString', 'params'=>'mixed'], -'HttpQueryString::offsetExists' => ['bool', 'offset'=>'mixed'], -'HttpQueryString::offsetGet' => ['mixed', 'offset'=>'mixed'], -'HttpQueryString::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'], -'HttpQueryString::offsetUnset' => ['void', 'offset'=>'mixed'], +'HttpQueryString::offsetExists' => ['bool', 'offset'=>'int|string'], +'HttpQueryString::offsetGet' => ['mixed', 'offset'=>'int|string'], +'HttpQueryString::offsetSet' => ['void', 'offset'=>'int|string|null', 'value'=>'mixed'], +'HttpQueryString::offsetUnset' => ['void', 'offset'=>'int|string'], 'HttpQueryString::serialize' => ['string'], 'HttpQueryString::set' => ['string', 'params'=>'mixed'], 'HttpQueryString::singleton' => ['HttpQueryString', 'global='=>'bool'], @@ -6189,10 +6189,10 @@ return [ 'Judy::memoryUsage' => ['int'], 'Judy::next' => ['mixed', 'index'=>'mixed'], 'Judy::nextEmpty' => ['mixed', 'index'=>'mixed'], -'Judy::offsetExists' => ['bool', 'offset'=>'mixed'], -'Judy::offsetGet' => ['mixed', 'offset'=>'mixed'], -'Judy::offsetSet' => ['bool', 'offset'=>'mixed', 'value'=>'mixed'], -'Judy::offsetUnset' => ['bool', 'offset'=>'mixed'], +'Judy::offsetExists' => ['bool', 'offset'=>'int|string'], +'Judy::offsetGet' => ['mixed', 'offset'=>'int|string'], +'Judy::offsetSet' => ['bool', 'offset'=>'int|string|null', 'value'=>'mixed'], +'Judy::offsetUnset' => ['bool', 'offset'=>'int|string'], 'Judy::prev' => ['mixed', 'index'=>'mixed'], 'Judy::prevEmpty' => ['mixed', 'index'=>'mixed'], 'Judy::size' => ['int'], @@ -9851,7 +9851,7 @@ return [ 'RecursiveArrayIterator::next' => ['void'], 'RecursiveArrayIterator::offsetExists' => ['bool', 'key'=>'string|int'], 'RecursiveArrayIterator::offsetGet' => ['mixed', 'key'=>'string|int'], -'RecursiveArrayIterator::offsetSet' => ['void', 'key'=>'string|int', 'value'=>'string'], +'RecursiveArrayIterator::offsetSet' => ['void', 'key'=>'string|int|null', 'value'=>'string'], 'RecursiveArrayIterator::offsetUnset' => ['void', 'key'=>'string|int'], 'RecursiveArrayIterator::rewind' => ['void'], 'RecursiveArrayIterator::seek' => ['void', 'offset'=>'int'], @@ -11340,7 +11340,7 @@ return [ 'SimpleXMLElement::getNamespaces' => ['array', 'recursive='=>'bool'], 'SimpleXMLElement::offsetExists' => ['bool', 'offset'=>'int|string'], 'SimpleXMLElement::offsetGet' => ['SimpleXMLElement', 'offset'=>'int|string'], -'SimpleXMLElement::offsetSet' => ['void', 'offset'=>'int|string', 'value'=>'mixed'], +'SimpleXMLElement::offsetSet' => ['void', 'offset'=>'int|string|null', 'value'=>'mixed'], 'SimpleXMLElement::offsetUnset' => ['void', 'offset'=>'int|string'], 'SimpleXMLElement::registerXPathNamespace' => ['bool', 'prefix'=>'string', 'namespace'=>'string'], 'SimpleXMLElement::saveXML' => ['string|bool', 'filename='=>'?string'], @@ -13653,10 +13653,10 @@ return [ 'Thread::merge' => ['bool', 'from'=>'', 'overwrite='=>'mixed'], 'Thread::notify' => ['bool'], 'Thread::notifyOne' => ['bool'], -'Thread::offsetExists' => ['bool', 'offset'=>'mixed'], -'Thread::offsetGet' => ['mixed', 'offset'=>'mixed'], -'Thread::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'], -'Thread::offsetUnset' => ['void', 'offset'=>'mixed'], +'Thread::offsetExists' => ['bool', 'offset'=>'int|string'], +'Thread::offsetGet' => ['mixed', 'offset'=>'int|string'], +'Thread::offsetSet' => ['void', 'offset'=>'int|string|null', 'value'=>'mixed'], +'Thread::offsetUnset' => ['void', 'offset'=>'int|string'], 'Thread::pop' => ['bool'], 'Thread::run' => ['void'], 'Thread::setGarbage' => ['void'], @@ -13682,10 +13682,10 @@ return [ 'Threaded::merge' => ['bool', 'from'=>'mixed', 'overwrite='=>'bool'], 'Threaded::notify' => ['bool'], 'Threaded::notifyOne' => ['bool'], -'Threaded::offsetExists' => ['bool', 'offset'=>'mixed'], -'Threaded::offsetGet' => ['mixed', 'offset'=>'mixed'], -'Threaded::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'], -'Threaded::offsetUnset' => ['void', 'offset'=>'mixed'], +'Threaded::offsetExists' => ['bool', 'offset'=>'int|string'], +'Threaded::offsetGet' => ['mixed', 'offset'=>'int|string'], +'Threaded::offsetSet' => ['void', 'offset'=>'int|string|null', 'value'=>'mixed'], +'Threaded::offsetUnset' => ['void', 'offset'=>'int|string'], 'Threaded::pop' => ['bool'], 'Threaded::run' => ['void'], 'Threaded::setGarbage' => ['void'], @@ -14607,10 +14607,10 @@ return [ 'Worker::merge' => ['bool', 'from'=>'', 'overwrite='=>'mixed'], 'Worker::notify' => ['bool'], 'Worker::notifyOne' => ['bool'], -'Worker::offsetExists' => ['bool', 'offset'=>'mixed'], -'Worker::offsetGet' => ['mixed', 'offset'=>'mixed'], -'Worker::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'], -'Worker::offsetUnset' => ['void', 'offset'=>'mixed'], +'Worker::offsetExists' => ['bool', 'offset'=>'int|string'], +'Worker::offsetGet' => ['mixed', 'offset'=>'int|string'], +'Worker::offsetSet' => ['void', 'offset'=>'int|string|null', 'value'=>'mixed'], +'Worker::offsetUnset' => ['void', 'offset'=>'int|string'], 'Worker::pop' => ['bool'], 'Worker::run' => ['void'], 'Worker::setGarbage' => ['void'], @@ -14940,10 +14940,10 @@ return [ 'Yaf\Config\Ini::get' => ['mixed', 'name='=>'mixed'], 'Yaf\Config\Ini::key' => ['int|string'], 'Yaf\Config\Ini::next' => ['void'], -'Yaf\Config\Ini::offsetExists' => ['bool', 'name'=>'mixed'], -'Yaf\Config\Ini::offsetGet' => ['mixed', 'name'=>'mixed'], -'Yaf\Config\Ini::offsetSet' => ['void', 'name'=>'mixed', 'value'=>'mixed'], -'Yaf\Config\Ini::offsetUnset' => ['void', 'name'=>'mixed'], +'Yaf\Config\Ini::offsetExists' => ['bool', 'name'=>'int|string'], +'Yaf\Config\Ini::offsetGet' => ['mixed', 'name'=>'int|string'], +'Yaf\Config\Ini::offsetSet' => ['void', 'name'=>'int|string|null', 'value'=>'mixed'], +'Yaf\Config\Ini::offsetUnset' => ['void', 'name'=>'int|string'], 'Yaf\Config\Ini::readonly' => ['bool'], 'Yaf\Config\Ini::rewind' => ['void'], 'Yaf\Config\Ini::set' => ['Yaf\Config_Abstract', 'name'=>'string', 'value'=>'mixed'], @@ -14958,10 +14958,10 @@ return [ 'Yaf\Config\Simple::get' => ['mixed', 'name='=>'mixed'], 'Yaf\Config\Simple::key' => ['int|string'], 'Yaf\Config\Simple::next' => ['void'], -'Yaf\Config\Simple::offsetExists' => ['bool', 'name'=>'mixed'], -'Yaf\Config\Simple::offsetGet' => ['mixed', 'name'=>'mixed'], -'Yaf\Config\Simple::offsetSet' => ['void', 'name'=>'mixed', 'value'=>'mixed'], -'Yaf\Config\Simple::offsetUnset' => ['void', 'name'=>'mixed'], +'Yaf\Config\Simple::offsetExists' => ['bool', 'name'=>'int|string'], +'Yaf\Config\Simple::offsetGet' => ['mixed', 'name'=>'int|string'], +'Yaf\Config\Simple::offsetSet' => ['void', 'name'=>'int|string|null', 'value'=>'mixed'], +'Yaf\Config\Simple::offsetUnset' => ['void', 'name'=>'int|string'], 'Yaf\Config\Simple::readonly' => ['bool'], 'Yaf\Config\Simple::rewind' => ['void'], 'Yaf\Config\Simple::set' => ['Yaf\Config_Abstract', 'name'=>'string', 'value'=>'mixed'], @@ -15228,10 +15228,10 @@ return [ 'Yaf\Session::has' => ['bool', 'name'=>'string'], 'Yaf\Session::key' => ['int|string'], 'Yaf\Session::next' => ['void'], -'Yaf\Session::offsetExists' => ['bool', 'name'=>'mixed'], -'Yaf\Session::offsetGet' => ['mixed', 'name'=>'mixed'], -'Yaf\Session::offsetSet' => ['void', 'name'=>'mixed', 'value'=>'mixed'], -'Yaf\Session::offsetUnset' => ['void', 'name'=>'mixed'], +'Yaf\Session::offsetExists' => ['bool', 'name'=>'int|string'], +'Yaf\Session::offsetGet' => ['mixed', 'name'=>'int|string'], +'Yaf\Session::offsetSet' => ['void', 'name'=>'int|string|null', 'value'=>'mixed'], +'Yaf\Session::offsetUnset' => ['void', 'name'=>'int|string'], 'Yaf\Session::rewind' => ['void'], 'Yaf\Session::set' => ['Yaf\Session|false', 'name'=>'string', 'value'=>'mixed'], 'Yaf\Session::start' => ['Yaf\Session'], From 3d8629fddc1434c8fee08bbe4a97984b1e9aaf4d Mon Sep 17 00:00:00 2001 From: kkmuffme <11071985+kkmuffme@users.noreply.github.com> Date: Wed, 5 Jul 2023 16:58:14 +0200 Subject: [PATCH 2/4] update historical --- dictionaries/CallMap_historical.php | 64 ++++++++++++++--------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/dictionaries/CallMap_historical.php b/dictionaries/CallMap_historical.php index 62a59df54..c816c535d 100644 --- a/dictionaries/CallMap_historical.php +++ b/dictionaries/CallMap_historical.php @@ -209,10 +209,10 @@ return [ 'ArithmeticError::getPrevious' => ['?Throwable'], 'ArithmeticError::getTrace' => ['list\',args?:array}>'], 'ArithmeticError::getTraceAsString' => ['string'], - 'ArrayAccess::offsetExists' => ['bool', 'offset'=>'mixed'], - 'ArrayAccess::offsetGet' => ['mixed', 'offset'=>'mixed'], - 'ArrayAccess::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'], - 'ArrayAccess::offsetUnset' => ['void', 'offset'=>'mixed'], + 'ArrayAccess::offsetExists' => ['bool', 'offset'=>'int|string'], + 'ArrayAccess::offsetGet' => ['mixed', 'offset'=>'int|string'], + 'ArrayAccess::offsetSet' => ['void', 'offset'=>'int|string|null', 'value'=>'mixed'], + 'ArrayAccess::offsetUnset' => ['void', 'offset'=>'int|string'], 'ArrayIterator::__construct' => ['void', 'array='=>'array|object', 'flags='=>'int'], 'ArrayIterator::append' => ['void', 'value'=>'mixed'], 'ArrayIterator::asort' => ['true', 'flags='=>'int'], @@ -227,7 +227,7 @@ return [ 'ArrayIterator::next' => ['void'], 'ArrayIterator::offsetExists' => ['bool', 'key'=>'string|int'], 'ArrayIterator::offsetGet' => ['mixed', 'key'=>'string|int'], - 'ArrayIterator::offsetSet' => ['void', 'key'=>'string|int', 'value'=>'mixed'], + 'ArrayIterator::offsetSet' => ['void', 'key'=>'string|int|null', 'value'=>'mixed'], 'ArrayIterator::offsetUnset' => ['void', 'key'=>'string|int'], 'ArrayIterator::rewind' => ['void'], 'ArrayIterator::seek' => ['void', 'offset'=>'int'], @@ -251,7 +251,7 @@ return [ 'ArrayObject::natsort' => ['true'], 'ArrayObject::offsetExists' => ['bool', 'key'=>'int|string'], 'ArrayObject::offsetGet' => ['mixed|null', 'key'=>'int|string'], - 'ArrayObject::offsetSet' => ['void', 'key'=>'int|string', 'value'=>'mixed'], + 'ArrayObject::offsetSet' => ['void', 'key'=>'int|string|null', 'value'=>'mixed'], 'ArrayObject::offsetUnset' => ['void', 'key'=>'int|string'], 'ArrayObject::serialize' => ['string'], 'ArrayObject::setFlags' => ['void', 'flags'=>'int'], @@ -2236,10 +2236,10 @@ return [ 'HttpQueryString::getObject' => ['', 'name'=>'', 'defval'=>'', 'delete'=>''], 'HttpQueryString::getString' => ['', 'name'=>'', 'defval'=>'', 'delete'=>''], 'HttpQueryString::mod' => ['HttpQueryString', 'params'=>'mixed'], - 'HttpQueryString::offsetExists' => ['bool', 'offset'=>'mixed'], - 'HttpQueryString::offsetGet' => ['mixed', 'offset'=>'mixed'], - 'HttpQueryString::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'], - 'HttpQueryString::offsetUnset' => ['void', 'offset'=>'mixed'], + 'HttpQueryString::offsetExists' => ['bool', 'offset'=>'int|string'], + 'HttpQueryString::offsetGet' => ['mixed', 'offset'=>'int|string'], + 'HttpQueryString::offsetSet' => ['void', 'offset'=>'int|string|null', 'value'=>'mixed'], + 'HttpQueryString::offsetUnset' => ['void', 'offset'=>'int|string'], 'HttpQueryString::serialize' => ['string'], 'HttpQueryString::set' => ['string', 'params'=>'mixed'], 'HttpQueryString::singleton' => ['HttpQueryString', 'global='=>'bool'], @@ -3289,10 +3289,10 @@ return [ 'Judy::memoryUsage' => ['int'], 'Judy::next' => ['mixed', 'index'=>'mixed'], 'Judy::nextEmpty' => ['mixed', 'index'=>'mixed'], - 'Judy::offsetExists' => ['bool', 'offset'=>'mixed'], - 'Judy::offsetGet' => ['mixed', 'offset'=>'mixed'], - 'Judy::offsetSet' => ['bool', 'offset'=>'mixed', 'value'=>'mixed'], - 'Judy::offsetUnset' => ['bool', 'offset'=>'mixed'], + 'Judy::offsetExists' => ['bool', 'offset'=>'int|string'], + 'Judy::offsetGet' => ['mixed', 'offset'=>'int|string'], + 'Judy::offsetSet' => ['bool', 'offset'=>'int|string|null', 'value'=>'mixed'], + 'Judy::offsetUnset' => ['bool', 'offset'=>'int|string'], 'Judy::prev' => ['mixed', 'index'=>'mixed'], 'Judy::prevEmpty' => ['mixed', 'index'=>'mixed'], 'Judy::size' => ['int'], @@ -5173,7 +5173,7 @@ return [ 'RecursiveArrayIterator::next' => ['void'], 'RecursiveArrayIterator::offsetExists' => ['bool', 'key'=>'string|int'], 'RecursiveArrayIterator::offsetGet' => ['mixed', 'key'=>'string|int'], - 'RecursiveArrayIterator::offsetSet' => ['void', 'key'=>'string|int', 'value'=>'string'], + 'RecursiveArrayIterator::offsetSet' => ['void', 'key'=>'string|int|null', 'value'=>'string'], 'RecursiveArrayIterator::offsetUnset' => ['void', 'key'=>'string|int'], 'RecursiveArrayIterator::rewind' => ['void'], 'RecursiveArrayIterator::seek' => ['void', 'offset'=>'int'], @@ -6677,7 +6677,7 @@ return [ 'SimpleXMLElement::getNamespaces' => ['array', 'recursive='=>'bool'], 'SimpleXMLElement::offsetExists' => ['bool', 'offset'=>'int|string'], 'SimpleXMLElement::offsetGet' => ['SimpleXMLElement', 'offset'=>'int|string'], - 'SimpleXMLElement::offsetSet' => ['void', 'offset'=>'int|string', 'value'=>'mixed'], + 'SimpleXMLElement::offsetSet' => ['void', 'offset'=>'int|string|null', 'value'=>'mixed'], 'SimpleXMLElement::offsetUnset' => ['void', 'offset'=>'int|string'], 'SimpleXMLElement::registerXPathNamespace' => ['bool', 'prefix'=>'string', 'namespace'=>'string'], 'SimpleXMLElement::saveXML' => ['string|bool', 'filename='=>'string'], @@ -7907,10 +7907,10 @@ return [ 'Thread::merge' => ['bool', 'from'=>'', 'overwrite='=>'mixed'], 'Thread::notify' => ['bool'], 'Thread::notifyOne' => ['bool'], - 'Thread::offsetExists' => ['bool', 'offset'=>'mixed'], - 'Thread::offsetGet' => ['mixed', 'offset'=>'mixed'], - 'Thread::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'], - 'Thread::offsetUnset' => ['void', 'offset'=>'mixed'], + 'Thread::offsetExists' => ['bool', 'offset'=>'int|string'], + 'Thread::offsetGet' => ['mixed', 'offset'=>'int|string'], + 'Thread::offsetSet' => ['void', 'offset'=>'int|string', 'value'=>'mixed'], + 'Thread::offsetUnset' => ['void', 'offset'=>'int|string'], 'Thread::pop' => ['bool'], 'Thread::run' => ['void'], 'Thread::setGarbage' => ['void'], @@ -7936,10 +7936,10 @@ return [ 'Threaded::merge' => ['bool', 'from'=>'mixed', 'overwrite='=>'bool'], 'Threaded::notify' => ['bool'], 'Threaded::notifyOne' => ['bool'], - 'Threaded::offsetExists' => ['bool', 'offset'=>'mixed'], - 'Threaded::offsetGet' => ['mixed', 'offset'=>'mixed'], - 'Threaded::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'], - 'Threaded::offsetUnset' => ['void', 'offset'=>'mixed'], + 'Threaded::offsetExists' => ['bool', 'offset'=>'int|string'], + 'Threaded::offsetGet' => ['mixed', 'offset'=>'int|string'], + 'Threaded::offsetSet' => ['void', 'offset'=>'int|string', 'value'=>'mixed'], + 'Threaded::offsetUnset' => ['void', 'offset'=>'int|string'], 'Threaded::pop' => ['bool'], 'Threaded::run' => ['void'], 'Threaded::setGarbage' => ['void'], @@ -8244,10 +8244,10 @@ return [ 'Worker::merge' => ['bool', 'from'=>'', 'overwrite='=>'mixed'], 'Worker::notify' => ['bool'], 'Worker::notifyOne' => ['bool'], - 'Worker::offsetExists' => ['bool', 'offset'=>'mixed'], - 'Worker::offsetGet' => ['mixed', 'offset'=>'mixed'], - 'Worker::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'], - 'Worker::offsetUnset' => ['void', 'offset'=>'mixed'], + 'Worker::offsetExists' => ['bool', 'offset'=>'int|string'], + 'Worker::offsetGet' => ['mixed', 'offset'=>'int|string'], + 'Worker::offsetSet' => ['void', 'offset'=>'int|string', 'value'=>'mixed'], + 'Worker::offsetUnset' => ['void', 'offset'=>'int|string'], 'Worker::pop' => ['bool'], 'Worker::run' => ['void'], 'Worker::setGarbage' => ['void'], @@ -11361,10 +11361,10 @@ return [ 'http\QueryString::getObject' => ['object|mixed', 'name'=>'string', 'defval='=>'mixed', 'delete='=>'bool|false'], 'http\QueryString::getString' => ['string|mixed', 'name'=>'string', 'defval='=>'mixed', 'delete='=>'bool|false'], 'http\QueryString::mod' => ['http\QueryString', 'params='=>'mixed'], - 'http\QueryString::offsetExists' => ['bool', 'offset'=>'mixed'], - 'http\QueryString::offsetGet' => ['mixed|null', 'offset'=>'mixed'], - 'http\QueryString::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'], - 'http\QueryString::offsetUnset' => ['void', 'offset'=>'mixed'], + 'http\QueryString::offsetExists' => ['bool', 'offset'=>'int|string'], + 'http\QueryString::offsetGet' => ['mixed|null', 'offset'=>'int|string'], + 'http\QueryString::offsetSet' => ['void', 'offset'=>'int|string', 'value'=>'mixed'], + 'http\QueryString::offsetUnset' => ['void', 'offset'=>'int|string'], 'http\QueryString::serialize' => ['string'], 'http\QueryString::set' => ['http\QueryString', 'params'=>'mixed'], 'http\QueryString::toArray' => ['array'], From 05f4e450266e988a5e5cd7cb8ff2a495bb982247 Mon Sep 17 00:00:00 2001 From: kkmuffme <11071985+kkmuffme@users.noreply.github.com> Date: Wed, 5 Jul 2023 17:04:43 +0200 Subject: [PATCH 3/4] more historical --- dictionaries/CallMap_historical.php | 40 ++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/dictionaries/CallMap_historical.php b/dictionaries/CallMap_historical.php index c816c535d..d20efff9f 100644 --- a/dictionaries/CallMap_historical.php +++ b/dictionaries/CallMap_historical.php @@ -7909,7 +7909,7 @@ return [ 'Thread::notifyOne' => ['bool'], 'Thread::offsetExists' => ['bool', 'offset'=>'int|string'], 'Thread::offsetGet' => ['mixed', 'offset'=>'int|string'], - 'Thread::offsetSet' => ['void', 'offset'=>'int|string', 'value'=>'mixed'], + 'Thread::offsetSet' => ['void', 'offset'=>'int|string|null', 'value'=>'mixed'], 'Thread::offsetUnset' => ['void', 'offset'=>'int|string'], 'Thread::pop' => ['bool'], 'Thread::run' => ['void'], @@ -7938,7 +7938,7 @@ return [ 'Threaded::notifyOne' => ['bool'], 'Threaded::offsetExists' => ['bool', 'offset'=>'int|string'], 'Threaded::offsetGet' => ['mixed', 'offset'=>'int|string'], - 'Threaded::offsetSet' => ['void', 'offset'=>'int|string', 'value'=>'mixed'], + 'Threaded::offsetSet' => ['void', 'offset'=>'int|string|null', 'value'=>'mixed'], 'Threaded::offsetUnset' => ['void', 'offset'=>'int|string'], 'Threaded::pop' => ['bool'], 'Threaded::run' => ['void'], @@ -8246,7 +8246,7 @@ return [ 'Worker::notifyOne' => ['bool'], 'Worker::offsetExists' => ['bool', 'offset'=>'int|string'], 'Worker::offsetGet' => ['mixed', 'offset'=>'int|string'], - 'Worker::offsetSet' => ['void', 'offset'=>'int|string', 'value'=>'mixed'], + 'Worker::offsetSet' => ['void', 'offset'=>'int|string|null', 'value'=>'mixed'], 'Worker::offsetUnset' => ['void', 'offset'=>'int|string'], 'Worker::pop' => ['bool'], 'Worker::run' => ['void'], @@ -8404,10 +8404,10 @@ return [ 'Yaf\Config\Ini::get' => ['mixed', 'name='=>'mixed'], 'Yaf\Config\Ini::key' => ['int|string'], 'Yaf\Config\Ini::next' => ['void'], - 'Yaf\Config\Ini::offsetExists' => ['bool', 'name'=>'mixed'], - 'Yaf\Config\Ini::offsetGet' => ['mixed', 'name'=>'mixed'], - 'Yaf\Config\Ini::offsetSet' => ['void', 'name'=>'mixed', 'value'=>'mixed'], - 'Yaf\Config\Ini::offsetUnset' => ['void', 'name'=>'mixed'], + 'Yaf\Config\Ini::offsetExists' => ['bool', 'name'=>'int|string'], + 'Yaf\Config\Ini::offsetGet' => ['mixed', 'name'=>'int|string'], + 'Yaf\Config\Ini::offsetSet' => ['void', 'name'=>'int|string|null', 'value'=>'mixed'], + 'Yaf\Config\Ini::offsetUnset' => ['void', 'name'=>'int|string'], 'Yaf\Config\Ini::readonly' => ['bool'], 'Yaf\Config\Ini::rewind' => ['void'], 'Yaf\Config\Ini::set' => ['Yaf\Config_Abstract', 'name'=>'string', 'value'=>'mixed'], @@ -8422,10 +8422,10 @@ return [ 'Yaf\Config\Simple::get' => ['mixed', 'name='=>'mixed'], 'Yaf\Config\Simple::key' => ['int|string'], 'Yaf\Config\Simple::next' => ['void'], - 'Yaf\Config\Simple::offsetExists' => ['bool', 'name'=>'mixed'], - 'Yaf\Config\Simple::offsetGet' => ['mixed', 'name'=>'mixed'], - 'Yaf\Config\Simple::offsetSet' => ['void', 'name'=>'mixed', 'value'=>'mixed'], - 'Yaf\Config\Simple::offsetUnset' => ['void', 'name'=>'mixed'], + 'Yaf\Config\Simple::offsetExists' => ['bool', 'name'=>'int|string'], + 'Yaf\Config\Simple::offsetGet' => ['mixed', 'name'=>'int|string'], + 'Yaf\Config\Simple::offsetSet' => ['void', 'name'=>'int|string|null', 'value'=>'mixed'], + 'Yaf\Config\Simple::offsetUnset' => ['void', 'name'=>'int|string'], 'Yaf\Config\Simple::readonly' => ['bool'], 'Yaf\Config\Simple::rewind' => ['void'], 'Yaf\Config\Simple::set' => ['Yaf\Config_Abstract', 'name'=>'string', 'value'=>'mixed'], @@ -8692,10 +8692,10 @@ return [ 'Yaf\Session::has' => ['bool', 'name'=>'string'], 'Yaf\Session::key' => ['int|string'], 'Yaf\Session::next' => ['void'], - 'Yaf\Session::offsetExists' => ['bool', 'name'=>'mixed'], - 'Yaf\Session::offsetGet' => ['mixed', 'name'=>'mixed'], - 'Yaf\Session::offsetSet' => ['void', 'name'=>'mixed', 'value'=>'mixed'], - 'Yaf\Session::offsetUnset' => ['void', 'name'=>'mixed'], + 'Yaf\Session::offsetExists' => ['bool', 'name'=>'int|string'], + 'Yaf\Session::offsetGet' => ['mixed', 'name'=>'int|string'], + 'Yaf\Session::offsetSet' => ['void', 'name'=>'int|string|null', 'value'=>'mixed'], + 'Yaf\Session::offsetUnset' => ['void', 'name'=>'int|string'], 'Yaf\Session::rewind' => ['void'], 'Yaf\Session::set' => ['Yaf\Session|false', 'name'=>'string', 'value'=>'mixed'], 'Yaf\Session::start' => ['Yaf\Session'], @@ -11343,10 +11343,10 @@ return [ 'http\Message\Parser::stream' => ['int', 'stream'=>'resource', 'flags'=>'int', '&message'=>'http\Message'], 'http\Params::__construct' => ['void', 'params='=>'mixed', 'param_sep='=>'mixed', 'arg_sep='=>'mixed', 'val_sep='=>'mixed', 'flags='=>'mixed'], 'http\Params::__toString' => ['string'], - 'http\Params::offsetExists' => ['bool', 'name'=>'mixed'], - 'http\Params::offsetGet' => ['mixed', 'name'=>'mixed'], - 'http\Params::offsetSet' => ['void', 'name'=>'mixed', 'value'=>'mixed'], - 'http\Params::offsetUnset' => ['void', 'name'=>'mixed'], + 'http\Params::offsetExists' => ['bool', 'name'=>'int|string'], + 'http\Params::offsetGet' => ['mixed', 'name'=>'int|string'], + 'http\Params::offsetSet' => ['void', 'name'=>'int|string|null', 'value'=>'mixed'], + 'http\Params::offsetUnset' => ['void', 'name'=>'int|string'], 'http\Params::toArray' => ['array'], 'http\Params::toString' => ['string'], 'http\QueryString::__construct' => ['void', 'querystring'=>'string'], @@ -11363,7 +11363,7 @@ return [ 'http\QueryString::mod' => ['http\QueryString', 'params='=>'mixed'], 'http\QueryString::offsetExists' => ['bool', 'offset'=>'int|string'], 'http\QueryString::offsetGet' => ['mixed|null', 'offset'=>'int|string'], - 'http\QueryString::offsetSet' => ['void', 'offset'=>'int|string', 'value'=>'mixed'], + 'http\QueryString::offsetSet' => ['void', 'offset'=>'int|string|null', 'value'=>'mixed'], 'http\QueryString::offsetUnset' => ['void', 'offset'=>'int|string'], 'http\QueryString::serialize' => ['string'], 'http\QueryString::set' => ['http\QueryString', 'params'=>'mixed'], From 9fd590685cd8266a21e7a604163565763148afc4 Mon Sep 17 00:00:00 2001 From: kkmuffme <11071985+kkmuffme@users.noreply.github.com> Date: Thu, 6 Jul 2023 08:20:46 +0200 Subject: [PATCH 4/4] fix "days" ignore falsable return not ignored correctly see Reflection.php, where the same condition was used already, but was insufficient --- .../PhpVisitor/Reflector/ClassLikeNodeScanner.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php b/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php index 2bc9d7180..fae0c8daf 100644 --- a/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php +++ b/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php @@ -839,10 +839,15 @@ class ClassLikeNodeScanner $classlike_storage->properties[$property_name] = new PropertyStorage(); } - $classlike_storage->properties[$property_name]->type = $property_type; - $property_id = $fq_classlike_name . '::$' . $property_name; + if ($property_id === 'DateInterval::$days') { + /** @psalm-suppress InaccessibleProperty We just parsed this type */ + $property_type->ignore_falsable_issues = true; + } + + $classlike_storage->properties[$property_name]->type = $property_type; + $classlike_storage->declaring_property_ids[$property_name] = $fq_classlike_name; $classlike_storage->appearing_property_ids[$property_name] = $property_id; }