Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions resources/functionMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -4565,6 +4565,8 @@
'imagecopyresampled' => ['bool', 'dst_im'=>'resource', 'src_im'=>'resource', 'dst_x'=>'int', 'dst_y'=>'int', 'src_x'=>'int', 'src_y'=>'int', 'dst_w'=>'int', 'dst_h'=>'int', 'src_w'=>'int', 'src_h'=>'int'],
'imagecopyresized' => ['bool', 'dst_im'=>'resource', 'src_im'=>'resource', 'dst_x'=>'int', 'dst_y'=>'int', 'src_x'=>'int', 'src_y'=>'int', 'dst_w'=>'int', 'dst_h'=>'int', 'src_w'=>'int', 'src_h'=>'int'],
'imagecreate' => ['__benevolent<resource|false>', 'x_size'=>'int<1, max>', 'y_size'=>'int<1, max>'],
'imagecreatefromavif' => ['resource|false', 'filename'=>'string'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was introduced only on PHP 8.1+
https://www.php.net/manual/en/function.imagecreatefromavif.php

And this is already understood by phpstan
https://phpstan.org/r/71e35147-854d-4225-8c18-9773f7f92489

'imagecreatefromtga' => ['resource|false', 'filename'=>'string'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was introduced only on PHP 7.4+
https://www.php.net/manual/en/function.imagecreatefromtga.php

And this is already understood by phpstan
https://phpstan.org/r/31a3e9a4-157c-4aaa-a22e-53ff9c748b27

'imagecreatefrombmp' => ['resource|false', 'filename'=>'string'],
'imagecreatefromgd' => ['resource|false', 'filename'=>'string'],
'imagecreatefromgd2' => ['resource|false', 'filename'=>'string'],
Expand Down Expand Up @@ -8274,8 +8276,8 @@
'odbc_pconnect' => ['resource', 'dsn'=>'string', 'user'=>'string', 'password'=>'string', 'cursor_option='=>'int'],
'odbc_prepare' => ['resource|false', 'connection_id'=>'resource', 'query'=>'string'],
'odbc_primarykeys' => ['resource', 'connection_id'=>'resource', 'qualifier'=>'string', 'owner'=>'string', 'table'=>'string'],
'odbc_procedurecolumns' => ['resource', 'connection_id'=>'', 'qualifier'=>'string', 'owner'=>'string', 'proc'=>'string', 'column'=>'string'],
'odbc_procedures' => ['resource', 'connection_id'=>'', 'qualifier'=>'string', 'owner'=>'string', 'name'=>'string'],
'odbc_procedurecolumns' => ['resource|false', 'odbc'=>'resource', 'catalog'=>'string|null', 'schema'=>'string|null', 'procedure'=>'string|null', 'column'=>'string|null'],
'odbc_procedures' => ['resource|false', 'odbc'=>'resource', 'catalog'=>'string|null', 'schema'=>'string|null', 'procedure'=>'string|null'],
'odbc_result' => ['mixed', 'result_id'=>'resource', 'field'=>'mixed'],
'odbc_result_all' => ['int|false', 'result_id'=>'resource', 'format='=>'string'],
'odbc_rollback' => ['bool', 'connection_id'=>'resource'],
Expand Down Expand Up @@ -8316,6 +8318,7 @@
'opendir' => ['resource|false', 'path'=>'string', 'context='=>'resource'],
'openlog' => ['bool', 'ident'=>'string', 'option'=>'int', 'facility'=>'int'],
'openssl_cipher_iv_length' => ['int|false', 'method'=>'string'],
'openssl_cipher_key_length' => ['int|false', 'cipher_algo'=>'string'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'openssl_csr_export' => ['bool', 'csr'=>'string|resource', '&w_out'=>'string', 'notext='=>'bool'],
'openssl_csr_export_to_file' => ['bool', 'csr'=>'string|resource', 'outfilename'=>'string', 'notext='=>'bool'],
'openssl_csr_get_public_key' => ['resource|false', 'csr'=>'string|resource', 'use_shortnames='=>'bool'],
Expand Down Expand Up @@ -8797,7 +8800,7 @@
'pg_lo_create' => ['int|false', 'connection='=>'resource', 'large_object_oid='=>''],
'pg_lo_export' => ['bool', 'connection'=>'resource', 'oid'=>'int', 'filename'=>'string'],
'pg_lo_export\'1' => ['bool', 'oid'=>'int', 'pathname'=>'string'],
'pg_lo_import' => ['int|false', 'connection'=>'resource', 'pathname'=>'string', 'oid'=>''],
'pg_lo_import' => ['int', 'connection'=>'resource', 'pathname'=>'string', 'object_id'=>'mixed'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

false is valid

The doc say
https://www.php.net/manual/en/function.pg-lo-import.php

The OID of the newly created large object, or [false](https://www.php.net/manual/en/reserved.constants.php#constant.false) on failure.

It should even be int|string|false
https://github.com/php/php-src/blob/1748b8111e97f14f709553c7a5498fcdfcd6c754/ext/pgsql/pgsql.stub.php#L348

'pg_lo_import\'1' => ['int', 'pathname'=>'string', 'oid'=>''],
'pg_lo_open' => ['resource|false', 'connection'=>'resource', 'oid'=>'int', 'mode'=>'string'],
'pg_lo_read' => ['string|false', 'large_object'=>'resource', 'len='=>'int'],
Expand Down Expand Up @@ -10706,6 +10709,8 @@
'sodium_bin2base64' => ['string', 'binary'=>'string', 'variant'=>'int'],
'sodium_bin2hex' => ['string', 'binary'=>'string'],
'sodium_compare' => ['int', 'string_1'=>'string', 'string_2'=>'string'],
'sodium_crypto_aead_aegis128l_decrypt' => ['string|false', 'ciphertext'=>'string', 'additional_data'=>'string', 'nonce'=>'string', 'key'=>'string'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'sodium_crypto_aead_aegis256_decrypt' => ['string|false', 'ciphertext'=>'string', 'additional_data'=>'string', 'nonce'=>'string', 'key'=>'string'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'sodium_crypto_aead_aes256gcm_decrypt' => ['string|false', 'confidential_message'=>'string', 'public_message'=>'string', 'nonce'=>'string', 'key'=>'string'],
'sodium_crypto_aead_aes256gcm_encrypt' => ['string', 'confidential_message'=>'string', 'public_message'=>'string', 'nonce'=>'string', 'key'=>'string'],
'sodium_crypto_aead_aes256gcm_is_available' => ['bool'],
Expand Down Expand Up @@ -11846,6 +11851,8 @@
'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', 'listener'=>'resource'],
'ssh2_forward_listen' => ['resource|false', 'session'=>'resource', 'port='=>'int', 'host'=>'string', 'connections'=>'int'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'ssh2_forward_listen' => ['resource|false', 'session'=>'resource', 'port='=>'int', 'host'=>'string', 'connections'=>'int'],
'ssh2_forward_listen' => ['resource|false', 'session'=>'resource', 'port'=>'int', 'host='=>'string', 'max_connections='=>'int'],

'ssh2_methods_negotiated' => ['array|false', 'session'=>'resource'],
'ssh2_publickey_add' => ['bool', 'pkey'=>'resource', 'algoname'=>'string', 'blob'=>'string', 'overwrite='=>'bool', 'attributes='=>'array'],
'ssh2_publickey_init' => ['resource|false', 'session'=>'resource'],
Expand Down
Loading