-
Notifications
You must be signed in to change notification settings - Fork 519
Update and add missing function signatures #3701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update and add missing function signatures #3701
Conversation
@@ -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'], |
There was a problem hiding this comment.
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
@@ -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'], | |||
'imagecreatefromtga' => ['resource|false', 'filename'=>'string'], |
There was a problem hiding this comment.
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
@@ -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'], |
There was a problem hiding this comment.
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.2+
https://www.php.net/manual/en/function.openssl-cipher-key-length.php
And this is understood by phpstan
https://phpstan.org/r/a1a5bd7b-83ef-48c4-9b28-4aac50a7caf3
@@ -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'], |
There was a problem hiding this comment.
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
@@ -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'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduced in PHP8.4+ only
https://www.php.net/manual/en/function.sodium-crypto-aead-aegis128l-decrypt.php
And already understood
https://phpstan.org/r/8b1fb06d-4b5b-43f2-b4fb-ff5a64d569cf
@@ -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'], | |||
'sodium_crypto_aead_aegis256_decrypt' => ['string|false', 'ciphertext'=>'string', 'additional_data'=>'string', 'nonce'=>'string', 'key'=>'string'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduced in PHP 8.4+
https://www.php.net/manual/en/function.sodium-crypto-aead-aegis256-decrypt.php
And already understood
https://phpstan.org/r/d60a847c-ad1d-4424-ac1d-e2d44b8fad55
@@ -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'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'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'], |
This PR will be covered by |
Thank you. |
https://www.php.net/manual/en/function.imagecreatefromavif.php
https://www.php.net/manual/en/function.imagecreatefromtga.php
https://www.php.net/manual/en/function.odbc-procedurecolumns.php
https://www.php.net/manual/en/function.odbc-procedures.php
https://www.php.net/manual/en/function.openssl-cipher-key-length.php
https://www.php.net/manual/en/function.pg-lo-import.php
https://www.php.net/manual/en/function.sodium-crypto-aead-aegis128l-decrypt.php
https://www.php.net/manual/en/function.sodium-crypto-aead-aegis256-decrypt.php
https://www.php.net/manual/en/function.ssh2-forward-accept.php
https://www.php.net/manual/en/function.ssh2-forward-listen.php