Skip to content

Commit

Permalink
Merge pull request #8684 from Nicelocal/merge_4.x_final
Browse files Browse the repository at this point in the history
Merge 4.x and documentation fixes
  • Loading branch information
orklah committed Nov 8, 2022
2 parents 4932337 + 0d0e965 commit 33c2d9d
Show file tree
Hide file tree
Showing 32 changed files with 618 additions and 192 deletions.
89 changes: 48 additions & 41 deletions dictionaries/CallMap.php
Expand Up @@ -2,7 +2,7 @@
namespace Phan\Language\Internal;

/**
* CURRENT PHP TARGET VERSION: 8.1
* CURRENT PHP TARGET VERSION: 8.2
* The version above has to match Psalm\Internal\Codebase\InternalCallMapHandler::PHP_(MAJOR|MINOR)_VERSION
*
* Format
Expand Down Expand Up @@ -1695,6 +1695,7 @@
'curl_share_setopt' => ['bool', 'share_handle'=>'CurlShareHandle', 'option'=>'int', 'value'=>'mixed'],
'curl_share_strerror' => ['?string', 'error_code'=>'int'],
'curl_strerror' => ['?string', 'error_code'=>'int'],
'curl_upkeep' => ['bool', 'handle'=>'CurlHandle'],
'curl_unescape' => ['string|false', 'handle'=>'CurlShareHandle', 'string'=>'string'],
'curl_version' => ['array', 'version='=>'int'],
'CURLFile::__construct' => ['void', 'filename'=>'string', 'mimetype='=>'string', 'postfilename='=>'string'],
Expand Down Expand Up @@ -6136,6 +6137,7 @@
'ini_get' => ['string|false', 'option'=>'string'],
'ini_get_all' => ['array|false', 'extension='=>'?string', 'details='=>'bool'],
'ini_restore' => ['void', 'option'=>'string'],
'ini_parse_quantity' => ['int', 'shorthand'=>'non-empty-string'],
'ini_set' => ['string|false', 'option'=>'string', 'value'=>'string|int|float|bool|null'],
'inotify_add_watch' => ['int', 'inotify_instance'=>'resource', 'pathname'=>'string', 'mask'=>'int'],
'inotify_init' => ['resource|false'],
Expand Down Expand Up @@ -7474,6 +7476,7 @@
'MemcachePool::setServerParams' => ['bool', 'host'=>'string', 'port='=>'int', 'timeout='=>'int', 'retry_interval='=>'int', 'status='=>'bool', 'failure_callback='=>'?callable'],
'memory_get_peak_usage' => ['int', 'real_usage='=>'bool'],
'memory_get_usage' => ['int', 'real_usage='=>'bool'],
'memory_reset_peak_usage' => ['void'],
'MessageFormatter::__construct' => ['void', 'locale'=>'string', 'pattern'=>'string'],
'MessageFormatter::create' => ['MessageFormatter', 'locale'=>'string', 'pattern'=>'string'],
'MessageFormatter::format' => ['false|string', 'args'=>'array'],
Expand Down Expand Up @@ -8442,6 +8445,7 @@
'mysqli::disable_reads_from_master' => ['bool'],
'mysqli::dump_debug_info' => ['bool'],
'mysqli::escape_string' => ['string', 'string'=>'string'],
'mysqli::execute_query' => ['mysqli_result|bool', 'query'=>'non-empty-string', 'params='=>'list<string>|null'],
'mysqli::get_charset' => ['object'],
'mysqli::get_client_info' => ['string'],
'mysqli::get_connection_stats' => ['array'],
Expand Down Expand Up @@ -8503,6 +8507,7 @@
'mysqli_error_list' => ['array', 'mysql'=>'mysqli'],
'mysqli_escape_string' => ['string', 'mysql'=>'mysqli', 'string'=>'string'],
'mysqli_execute' => ['bool', 'statement'=>'mysqli_stmt', 'params='=>'list<mixed>|null'],
'mysqli_execute_query' => ['mysqli_result|bool', 'mysqli'=>'mysqli', 'query'=>'non-empty-string', 'params='=>'list<string>|null'],
'mysqli_fetch_all' => ['list<array<array-key,null|int|float|string>>', 'result'=>'mysqli_result', 'mode='=>'3'],
'mysqli_fetch_all\'1' => ['list<array<string,null|int|float|string>>', 'result'=>'mysqli_result', 'mode='=>'1'],
'mysqli_fetch_all\'2' => ['list<list<null|int|float|string>>', 'result'=>'mysqli_result', 'mode='=>'2'],
Expand Down Expand Up @@ -9276,7 +9281,7 @@
'ocigetbufferinglob' => ['bool'],
'ocisetbufferinglob' => ['bool', 'lob'=>'bool'],
'octdec' => ['int|float', 'octal_string'=>'string'],
'odbc_autocommit' => ['mixed', 'odbc'=>'resource', 'enable='=>'bool'],
'odbc_autocommit' => ['int|bool', 'odbc'=>'resource', 'enable='=>'bool'],
'odbc_binmode' => ['bool', 'statement'=>'resource', 'mode'=>'int'],
'odbc_close' => ['void', 'odbc'=>'resource'],
'odbc_close_all' => ['void'],
Expand All @@ -9293,7 +9298,7 @@
'odbc_execute' => ['bool', 'statement'=>'resource', 'params='=>'array'],
'odbc_fetch_array' => ['array|false', 'statement'=>'resource', 'row='=>'int'],
'odbc_fetch_into' => ['int', 'statement'=>'resource', '&w_array'=>'array', 'row='=>'int'],
'odbc_fetch_object' => ['object|false', 'statement'=>'resource', 'row='=>'int'],
'odbc_fetch_object' => ['stdClass|false', 'statement'=>'resource', 'row='=>'int'],
'odbc_fetch_row' => ['bool', 'statement'=>'resource', 'row='=>'int'],
'odbc_field_len' => ['int|false', 'statement'=>'resource', 'field'=>'int'],
'odbc_field_name' => ['string|false', 'statement'=>'resource', 'field'=>'int'],
Expand Down Expand Up @@ -9353,6 +9358,7 @@
'opendir' => ['resource|false', 'directory'=>'string', 'context='=>'resource'],
'openlog' => ['bool', 'prefix'=>'string', 'flags'=>'int', 'facility'=>'int'],
'openssl_cipher_iv_length' => ['int|false', 'cipher_algo'=>'string'],
'openssl_cipher_key_length' => ['positive-int|false', 'cipher_algo'=>'non-empty-string'],
'openssl_csr_export' => ['bool', 'csr'=>'OpenSSLCertificateSigningRequest|string', '&w_output'=>'string', 'no_text='=>'bool'],
'openssl_csr_export_to_file' => ['bool', 'csr'=>'OpenSSLCertificateSigningRequest|string', 'output_filename'=>'string', 'no_text='=>'bool'],
'openssl_csr_get_public_key' => ['OpenSSLAsymmetricKey|false', 'csr'=>'OpenSSLCertificateSigningRequest|string', 'short_names='=>'bool'],
Expand Down Expand Up @@ -9409,6 +9415,7 @@
'openssl_x509_free' => ['void', 'certificate'=>'OpenSSLCertificate'],
'openssl_x509_parse' => ['array|false', 'certificate'=>'OpenSSLCertificate|string', 'short_names='=>'bool'],
'openssl_x509_read' => ['OpenSSLCertificate|false', 'certificate'=>'OpenSSLCertificate|string'],
'openssl_x509_verify' => ['int', 'certificate'=>'string|OpenSSLCertificate', 'public_key'=>'string|OpenSSLCertificate|OpenSSLAsymmetricKey|array'],
'ord' => ['int', 'character'=>'string'],
'OuterIterator::current' => ['mixed'],
'OuterIterator::getInnerIterator' => ['Iterator'],
Expand Down Expand Up @@ -11438,7 +11445,7 @@
'ReflectionExtension::getFunctions' => ['array<string,ReflectionFunction>'],
'ReflectionExtension::getINIEntries' => ['array<string,mixed>'],
'ReflectionExtension::getName' => ['string'],
'ReflectionExtension::getVersion' => ['string'],
'ReflectionExtension::getVersion' => ['?string'],
'ReflectionExtension::info' => ['void'],
'ReflectionExtension::isPersistent' => ['bool'],
'ReflectionExtension::isTemporary' => ['bool'],
Expand Down Expand Up @@ -13218,24 +13225,24 @@
'SplFileInfo::__construct' => ['void', 'file_name'=>'string'],
'SplFileInfo::__toString' => ['string'],
'SplFileInfo::__wakeup' => ['void'],
'SplFileInfo::getATime' => ['int'],
'SplFileInfo::getATime' => ['int|false'],
'SplFileInfo::getBasename' => ['string', 'suffix='=>'string'],
'SplFileInfo::getCTime' => ['int'],
'SplFileInfo::getCTime' => ['int|false'],
'SplFileInfo::getExtension' => ['string'],
'SplFileInfo::getFileInfo' => ['SplFileInfo', 'class_name='=>'string'],
'SplFileInfo::getFilename' => ['string'],
'SplFileInfo::getGroup' => ['int'],
'SplFileInfo::getInode' => ['int'],
'SplFileInfo::getLinkTarget' => ['string'],
'SplFileInfo::getMTime' => ['int'],
'SplFileInfo::getOwner' => ['int'],
'SplFileInfo::getGroup' => ['int|false'],
'SplFileInfo::getInode' => ['int|false'],
'SplFileInfo::getLinkTarget' => ['string|false'],
'SplFileInfo::getMTime' => ['int|false'],
'SplFileInfo::getOwner' => ['int|false'],
'SplFileInfo::getPath' => ['string'],
'SplFileInfo::getPathInfo' => ['SplFileInfo', 'class_name='=>'string'],
'SplFileInfo::getPathInfo' => ['SplFileInfo|null', 'class_name='=>'string'],
'SplFileInfo::getPathname' => ['string'],
'SplFileInfo::getPerms' => ['int'],
'SplFileInfo::getPerms' => ['int|false'],
'SplFileInfo::getRealPath' => ['string|false'],
'SplFileInfo::getSize' => ['int'],
'SplFileInfo::getType' => ['string'],
'SplFileInfo::getSize' => ['int|false'],
'SplFileInfo::getType' => ['string|false'],
'SplFileInfo::isDir' => ['bool'],
'SplFileInfo::isExecutable' => ['bool'],
'SplFileInfo::isFile' => ['bool'],
Expand Down Expand Up @@ -13263,29 +13270,29 @@
'SplFileObject::ftell' => ['int|false'],
'SplFileObject::ftruncate' => ['bool', 'size'=>'int'],
'SplFileObject::fwrite' => ['int', 'string'=>'string', 'length='=>'int'],
'SplFileObject::getATime' => ['int'],
'SplFileObject::getATime' => ['int|false'],
'SplFileObject::getBasename' => ['string', 'suffix='=>'string'],
'SplFileObject::getChildren' => ['null'],
'SplFileObject::getCsvControl' => ['array'],
'SplFileObject::getCTime' => ['int'],
'SplFileObject::getCTime' => ['int|false'],
'SplFileObject::getCurrentLine' => ['string|false'],
'SplFileObject::getExtension' => ['string'],
'SplFileObject::getFileInfo' => ['SplFileInfo', 'class_name='=>'string'],
'SplFileObject::getFilename' => ['string'],
'SplFileObject::getFlags' => ['int'],
'SplFileObject::getGroup' => ['int'],
'SplFileObject::getInode' => ['int'],
'SplFileObject::getLinkTarget' => ['string'],
'SplFileObject::getGroup' => ['int|false'],
'SplFileObject::getInode' => ['int|false'],
'SplFileObject::getLinkTarget' => ['string|false'],
'SplFileObject::getMaxLineLen' => ['int'],
'SplFileObject::getMTime' => ['int'],
'SplFileObject::getOwner' => ['int'],
'SplFileObject::getMTime' => ['int|false'],
'SplFileObject::getOwner' => ['int|false'],
'SplFileObject::getPath' => ['string'],
'SplFileObject::getPathInfo' => ['SplFileInfo', 'class_name='=>'string'],
'SplFileObject::getPathInfo' => ['SplFileInfo|null', 'class_name='=>'string'],
'SplFileObject::getPathname' => ['string'],
'SplFileObject::getPerms' => ['int'],
'SplFileObject::getPerms' => ['int|false'],
'SplFileObject::getRealPath' => ['false|string'],
'SplFileObject::getSize' => ['int'],
'SplFileObject::getType' => ['string'],
'SplFileObject::getSize' => ['int|false'],
'SplFileObject::getType' => ['string|false'],
'SplFileObject::hasChildren' => ['false'],
'SplFileObject::isDir' => ['bool'],
'SplFileObject::isExecutable' => ['bool'],
Expand Down Expand Up @@ -13456,29 +13463,29 @@
'SplTempFileObject::ftell' => ['int'],
'SplTempFileObject::ftruncate' => ['bool', 'size'=>'int'],
'SplTempFileObject::fwrite' => ['int', 'string'=>'string', 'length='=>'int'],
'SplTempFileObject::getATime' => ['int'],
'SplTempFileObject::getATime' => ['int|false'],
'SplTempFileObject::getBasename' => ['string', 'suffix='=>'string'],
'SplTempFileObject::getChildren' => ['null'],
'SplTempFileObject::getCsvControl' => ['array'],
'SplTempFileObject::getCTime' => ['int'],
'SplTempFileObject::getCTime' => ['int|false'],
'SplTempFileObject::getCurrentLine' => ['string'],
'SplTempFileObject::getExtension' => ['string'],
'SplTempFileObject::getFileInfo' => ['SplFileInfo', 'class_name='=>'string'],
'SplTempFileObject::getFilename' => ['string'],
'SplTempFileObject::getFlags' => ['int'],
'SplTempFileObject::getGroup' => ['int'],
'SplTempFileObject::getInode' => ['int'],
'SplTempFileObject::getLinkTarget' => ['string'],
'SplTempFileObject::getGroup' => ['int|false'],
'SplTempFileObject::getInode' => ['int|false'],
'SplTempFileObject::getLinkTarget' => ['string|false'],
'SplTempFileObject::getMaxLineLen' => ['int'],
'SplTempFileObject::getMTime' => ['int'],
'SplTempFileObject::getOwner' => ['int'],
'SplTempFileObject::getMTime' => ['int|false'],
'SplTempFileObject::getOwner' => ['int|false'],
'SplTempFileObject::getPath' => ['string'],
'SplTempFileObject::getPathInfo' => ['SplFileInfo', 'class_name='=>'string'],
'SplTempFileObject::getPathname' => ['string'],
'SplTempFileObject::getPerms' => ['int'],
'SplTempFileObject::getRealPath' => ['string'],
'SplTempFileObject::getSize' => ['int'],
'SplTempFileObject::getType' => ['string'],
'SplTempFileObject::getPerms' => ['int|false'],
'SplTempFileObject::getRealPath' => ['string|false'],
'SplTempFileObject::getSize' => ['int|false'],
'SplTempFileObject::getType' => ['string|false'],
'SplTempFileObject::hasChildren' => ['bool'],
'SplTempFileObject::isDir' => ['bool'],
'SplTempFileObject::isExecutable' => ['bool'],
Expand Down Expand Up @@ -13677,7 +13684,7 @@
'ssh2_exec' => ['resource|false', 'session'=>'resource', 'command'=>'string', 'pty='=>'string', 'env='=>'array', 'width='=>'int', 'height='=>'int', 'width_height_type='=>'int'],
'ssh2_fetch_stream' => ['resource|false', 'channel'=>'resource', 'streamid'=>'int'],
'ssh2_fingerprint' => ['string|false', 'session'=>'resource', 'flags='=>'int'],
'ssh2_forward_accept' => ['resource|false', 'session'=>'resource'],
'ssh2_forward_accept' => ['resource|false', 'listener'=>'resource'],
'ssh2_forward_listen' => ['resource|false', 'session'=>'resource', 'port'=>'int', 'host='=>'string', 'max_connections='=>'string'],
'ssh2_methods_negotiated' => ['array|false', 'session'=>'resource'],
'ssh2_poll' => ['int', '&polldes'=>'array', 'timeout='=>'int'],
Expand All @@ -13698,7 +13705,7 @@
'ssh2_sftp_stat' => ['strict-array{0: int, 1: int, 2: int, 3: int, 4: int, 5: int, 6: int, 7: int, 8: int, 9: int, 10: int, 11: int, 12: int, dev: int, ino: int, mode: int, nlink: int, uid: int, gid: int, rdev: int, size: int, atime: int, mtime: int, ctime: int, blksize: int, blocks: int}|false', 'sftp'=>'resource', 'path'=>'string'],
'ssh2_sftp_symlink' => ['bool', 'sftp'=>'resource', 'target'=>'string', 'link'=>'string'],
'ssh2_sftp_unlink' => ['bool', 'sftp'=>'resource', 'filename'=>'string'],
'ssh2_shell' => ['resource|false', 'session'=>'resource', 'term_type='=>'string', 'env='=>'array', 'width='=>'int', 'height='=>'int', 'width_height_type='=>'int'],
'ssh2_shell' => ['resource|false', 'session'=>'resource', 'termtype='=>'string', 'env='=>'array', 'width='=>'int', 'height='=>'int', 'width_height_type='=>'int'],
'ssh2_tunnel' => ['resource|false', 'session'=>'resource', 'host'=>'string', 'port'=>'int'],
'stat' => ['strict-array{0: int, 1: int, 2: int, 3: int, 4: int, 5: int, 6: int, 7: int, 8: int, 9: int, 10: int, 11: int, 12: int, dev: int, ino: int, mode: int, nlink: int, uid: int, gid: int, rdev: int, size: int, atime: int, mtime: int, ctime: int, blksize: int, blocks: int}|false', 'filename'=>'string'],
'stats_absolute_deviation' => ['float', 'a'=>'array'],
Expand Down Expand Up @@ -13818,7 +13825,7 @@
'str_replace' => ['string|string[]', 'search'=>'string|array', 'replace'=>'string|array', 'subject'=>'string|array', '&w_count='=>'int'],
'str_rot13' => ['string', 'string'=>'string'],
'str_shuffle' => ['string', 'string'=>'string'],
'str_split' => ['non-empty-list<string>', 'string'=>'string', 'length='=>'positive-int'],
'str_split' => ['list<string>', 'string'=>'string', 'length='=>'positive-int'],
'str_starts_with' => ['bool', 'haystack'=>'string', 'needle'=>'string'],
'str_word_count' => ['array<int, string>|int', 'string'=>'string', 'format='=>'int', 'characters='=>'string'],
'strcasecmp' => ['int', 'string1'=>'string', 'string2'=>'string'],
Expand Down Expand Up @@ -15670,7 +15677,7 @@
'XMLDiff\Memory::diff' => ['string', 'from'=>'string', 'to'=>'string'],
'XMLDiff\Memory::merge' => ['string', 'src'=>'string', 'diff'=>'string'],
'XMLReader::close' => ['bool'],
'XMLReader::expand' => ['DOMNode|false', 'basenode='=>'DOMNode'],
'XMLReader::expand' => ['DOMNode|false', 'baseNode='=>'?DOMNode'],
'XMLReader::getAttribute' => ['?string', 'name'=>'string'],
'XMLReader::getAttributeNo' => ['?string', 'index'=>'int'],
'XMLReader::getAttributeNs' => ['?string', 'name'=>'string', 'namespaceuri'=>'string'],
Expand Down
1 change: 1 addition & 0 deletions dictionaries/CallMap_74_delta.php
Expand Up @@ -18,6 +18,7 @@
'added' => [
'ReflectionProperty::getType' => ['?ReflectionType'],
'mb_str_split' => ['list<string>|false', 'string'=>'string', 'length='=>'positive-int', 'encoding='=>'string'],
'openssl_x509_verify' => ['int', 'certificate'=>'string|resource', 'public_key'=>'string|array|resource'],
],
'changed' => [
'array_merge' => [
Expand Down
4 changes: 4 additions & 0 deletions dictionaries/CallMap_80_delta.php
Expand Up @@ -1201,6 +1201,10 @@
'old' => ['resource|false', 'certificate'=>'string|resource'],
'new' => ['OpenSSLCertificate|false', 'certificate'=>'OpenSSLCertificate|string'],
],
'openssl_x509_verify' => [
'old' => ['int', 'certificate'=>'string|resource', 'public_key'=>'string|array|resource'],
'new' => ['int', 'certificate'=>'string|OpenSSLCertificate', 'public_key'=>'string|OpenSSLCertificate|OpenSSLAsymmetricKey|array'],
],
'parse_str' => [
'old' => ['void', 'string'=>'string', '&w_result='=>'array'],
'new' => ['void', 'string'=>'string', '&w_result'=>'array'],
Expand Down
36 changes: 36 additions & 0 deletions dictionaries/CallMap_82_delta.php
@@ -0,0 +1,36 @@
<?php // phpcs:ignoreFile

/**
* This contains the information needed to convert the function signatures for php 8.2 to php 8.1 (and vice versa)
*
* This file has three sections.
* The 'added' section contains function/method names from FunctionSignatureMap (And alternates, if applicable) that do not exist in php 8.1
* The 'removed' section contains the signatures that were removed in php 8.2
* The 'changed' section contains functions for which the signature has changed for php 8.2.
* Each function in the 'changed' section has an 'old' and a 'new' section,
* representing the function as it was in PHP 8.1 and in PHP 8.2, respectively
*
* @see CallMap.php
*
* @phan-file-suppress PhanPluginMixedKeyNoKey (read by Phan when analyzing this file)
*/
return [
'added' => [
'mysqli_execute_query' => ['mysqli_result|bool', 'mysqli'=>'mysqli', 'query'=>'non-empty-string', 'params='=>'list<string>|null'],
'mysqli::execute_query' => ['mysqli_result|bool', 'query'=>'non-empty-string', 'params='=>'list<string>|null'],
'openssl_cipher_key_length' => ['positive-int|false', 'cipher_algo'=>'non-empty-string'],
'curl_upkeep' => ['bool', 'handle'=>'CurlHandle'],
'ini_parse_quantity' => ['int', 'shorthand'=>'non-empty-string'],
'memory_reset_peak_usage' => ['void'],
],

'changed' => [
'str_split' => [
'old' => ['non-empty-list<string>', 'string'=>'string', 'length='=>'positive-int'],
'new' => ['list<string>', 'string'=>'string', 'length='=>'positive-int'],
],
],

'removed' => [
],
];

0 comments on commit 33c2d9d

Please sign in to comment.