Skip to content
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

improved parameter generation (both signature and doc-block) #134

Merged
merged 3 commits into from
Oct 18, 2019
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions generated/apc.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function apc_compile_file(string $filename, bool $atomic = true)
*
* @param string $key The key of the value being decreased.
* @param int $step The step, or value to decrease.
* @param bool $success Optionally pass the success or fail boolean value to
* @param bool|null $success Optionally pass the success or fail boolean value to
* this referenced variable.
* @return int Returns the current value of key's value on success
* @throws ApcException
Expand Down Expand Up @@ -164,7 +164,7 @@ function apc_delete_file($keys)
* @throws ApcException
*
*/
function apc_delete(string $key)
function apc_delete($key)
{
error_clear_last();
$result = \apc_delete($key);
Expand All @@ -180,7 +180,7 @@ function apc_delete(string $key)
*
* @param string $key The key of the value being increased.
* @param int $step The step, or value to increase.
* @param bool $success Optionally pass the success or fail boolean value to
* @param bool|null $success Optionally pass the success or fail boolean value to
* this referenced variable.
* @return int Returns the current value of key's value on success
* @throws ApcException
Expand Down
4 changes: 2 additions & 2 deletions generated/apcu.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function apcu_cas(string $key, int $old, int $new): void
*
* @param string $key The key of the value being decreased.
* @param int $step The step, or value to decrease.
* @param bool $success Optionally pass the success or fail boolean value to
* @param bool|null $success Optionally pass the success or fail boolean value to
* this referenced variable.
* @param int $ttl TTL to use if the operation inserts a new value (rather than decrementing an existing one).
* @return int Returns the current value of key's value on success
Expand Down Expand Up @@ -97,7 +97,7 @@ function apcu_delete($key)
*
* @param string $key The key of the value being increased.
* @param int $step The step, or value to increase.
* @param bool $success Optionally pass the success or fail boolean value to
* @param bool|null $success Optionally pass the success or fail boolean value to
* this referenced variable.
* @param int $ttl TTL to use if the operation inserts a new value (rather than incrementing an existing one).
* @return int Returns the current value of key's value on success
Expand Down
4 changes: 2 additions & 2 deletions generated/array.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function array_multisort(array &$array1, $array1_sort_order = SORT_ASC, $array1_
*
* @param array $array1 The array in which elements are replaced.
* @param array $params Optional. Arrays from which elements will be extracted.
* @return array Returns an array, or NULL if an error occurs.
* @return array|null Returns an array, or NULL if an error occurs.
* @throws ArrayException
*
*/
Expand Down Expand Up @@ -188,7 +188,7 @@ function array_replace_recursive(array $array1, array ...$params): array
* @param array $array1 The array in which elements are replaced.
* @param array $params Arrays from which elements will be extracted.
* Values from later arrays overwrite the previous values.
* @return array Returns an array, or NULL if an error occurs.
* @return array|null Returns an array, or NULL if an error occurs.
* @throws ArrayException
*
*/
Expand Down
2 changes: 0 additions & 2 deletions generated/bzip2.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*
* @param resource $bz The file pointer. It must be valid and must point to a file
* successfully opened by bzopen.
* @return int Returns TRUE on success.
* @throws Bzip2Exception
*
*/
Expand All @@ -29,7 +28,6 @@ function bzclose($bz): void
*
* @param resource $bz The file pointer. It must be valid and must point to a file
* successfully opened by bzopen.
* @return int Returns TRUE on success.
* @throws Bzip2Exception
*
*/
Expand Down
2 changes: 1 addition & 1 deletion generated/com.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @throws ComException
*
*/
function com_event_sink(variant $comobject, object $sinkobject, $sinkinterface = null): void
function com_event_sink(object $comobject, object $sinkobject, $sinkinterface = null): void
{
error_clear_last();
if ($sinkinterface !== null) {
Expand Down
4 changes: 2 additions & 2 deletions generated/curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ function curl_multi_errno($mh): int
*
* @param resource $mh A cURL multi handle returned by
* curl_multi_init.
* @param int $msgs_in_queue Number of messages that are still in the queue
* @param int|null $msgs_in_queue Number of messages that are still in the queue
* @return array On success, returns an associative array for the message, FALSE on failure.
*
*
Expand Down Expand Up @@ -528,7 +528,7 @@ function curl_multi_errno($mh): int
* @throws CurlException
*
*/
function curl_multi_info_read($mh, int &$msgs_in_queue = null): array
function curl_multi_info_read($mh, ?int &$msgs_in_queue = null): array
{
error_clear_last();
$result = \curl_multi_info_read($mh, $msgs_in_queue);
Expand Down
2 changes: 1 addition & 1 deletion generated/filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ function filesize(string $filename): int
* It is also possible to add LOCK_NB as a bitmask to one
* of the above operations if you don't want flock to
* block while locking.
* @param int $wouldblock The optional third argument is set to 1 if the lock would block
* @param int|null $wouldblock The optional third argument is set to 1 if the lock would block
* (EWOULDBLOCK errno condition).
* @throws FilesystemException
*
Expand Down
8 changes: 4 additions & 4 deletions generated/ftp.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function ftp_alloc($ftp_stream, int $filesize, string &$result = null): void
* @throws FtpException
*
*/
function ftp_append($ftp, string $remote_file, string $local_file, int $mode = FTP_IMAGE): void
function ftp_append($ftp, string $remote_file, string $local_file, int $mode = FTP_BINARY): void
{
error_clear_last();
$result = \ftp_append($ftp, $remote_file, $local_file, $mode);
Expand Down Expand Up @@ -179,7 +179,7 @@ function ftp_delete($ftp_stream, string $path): void
* @throws FtpException
*
*/
function ftp_fget($ftp_stream, $handle, string $remote_file, int $mode = FTP_IMAGE, int $resumepos = 0): void
function ftp_fget($ftp_stream, $handle, string $remote_file, int $mode = FTP_BINARY, int $resumepos = 0): void
{
error_clear_last();
$result = \ftp_fget($ftp_stream, $handle, $remote_file, $mode, $resumepos);
Expand All @@ -202,7 +202,7 @@ function ftp_fget($ftp_stream, $handle, string $remote_file, int $mode = FTP_IMA
* @throws FtpException
*
*/
function ftp_fput($ftp_stream, string $remote_file, $handle, int $mode = FTP_IMAGE, int $startpos = 0): void
function ftp_fput($ftp_stream, string $remote_file, $handle, int $mode = FTP_BINARY, int $startpos = 0): void
{
error_clear_last();
$result = \ftp_fput($ftp_stream, $remote_file, $handle, $mode, $startpos);
Expand Down Expand Up @@ -353,7 +353,7 @@ function ftp_pasv($ftp_stream, bool $pasv): void
* @throws FtpException
*
*/
function ftp_put($ftp_stream, string $remote_file, string $local_file, int $mode = FTP_IMAGE, int $startpos = 0): void
function ftp_put($ftp_stream, string $remote_file, string $local_file, int $mode = FTP_BINARY, int $startpos = 0): void
{
error_clear_last();
$result = \ftp_put($ftp_stream, $remote_file, $local_file, $mode, $startpos);
Expand Down
2 changes: 1 addition & 1 deletion generated/funchand.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function create_function(string $args, string $code): string
/**
*
*
* @param callable $function The function to register.
* @param callable(): void $function The function to register.
* @param mixed $params
* @throws FunchandException
*
Expand Down
6 changes: 3 additions & 3 deletions generated/gmp.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
/**
* Calculates the binomial coefficient C(n, k).
*
* @param mixed $n Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number.
* @param \GMP|string|int $n Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number.
* @param int $k
* @return \\GMP Returns the binomial coefficient C(n, k).
* @return \GMP Returns the binomial coefficient C(n, k).
* @throws GmpException
*
*/
Expand All @@ -34,7 +34,7 @@ function gmp_binomial($n, int $k): \GMP
* @throws GmpException
*
*/
function gmp_export(\GMP $gmpnumber, int $word_size = 1, int $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): string
function gmp_export($gmpnumber, int $word_size = 1, int $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN): string
{
error_clear_last();
$result = \gmp_export($gmpnumber, $word_size, $options);
Expand Down
2 changes: 1 addition & 1 deletion generated/hash.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function hash_hkdf(string $algo, string $ikm, int $length = 0, string $info = ''
* @throws HashException
*
*/
function hash_update_file(\HashContext $hcontext, string $filename, $scontext = null): void
function hash_update_file(\HashContext $hcontext, string $filename, ?\HashContext $scontext = null): void
{
error_clear_last();
$result = \hash_update_file($hcontext, $filename, $scontext);
Expand Down
4 changes: 2 additions & 2 deletions generated/ibmDb2.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* @param resource $connection A valid database connection resource variable as returned from
* db2_connect or db2_pconnect.
* @param bool $value One of the following constants:
* @param int $value One of the following constants:
*
*
* DB2_AUTOCOMMIT_OFF
Expand Down Expand Up @@ -46,7 +46,7 @@
* @throws IbmDb2Exception
*
*/
function db2_autocommit($connection, bool $value = null)
function db2_autocommit($connection, int $value = null)
{
error_clear_last();
if ($value !== null) {
Expand Down
6 changes: 3 additions & 3 deletions generated/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function imageaffine($image, array $affine, array $clip = null)
* 0 to 5 and float values).
* @param array $m2 An affine transformation matrix (an array with keys
* 0 to 5 and float values).
* @return array An affine transformation matrix (an array with keys
* @return array{0:float,1:float,2:float,3:float,4:float,5:float} An affine transformation matrix (an array with keys
* 0 to 5 and float values).
* @throws ImageException
*
Expand All @@ -162,15 +162,15 @@ function imageaffinematrixconcat(array $m1, array $m2): array
* Returns an affine transformation matrix.
*
* @param int $type One of the IMG_AFFINE_* constants.
* @param array $options If type is IMG_AFFINE_TRANSLATE
* @param array|float $options If type is IMG_AFFINE_TRANSLATE
* or IMG_AFFINE_SCALE,
* options has to be an array with keys x
* and y, both having float values.
*
* If type is IMG_AFFINE_ROTATE,
* IMG_AFFINE_SHEAR_HORIZONTAL or IMG_AFFINE_SHEAR_VERTICAL,
* options has to be a float specifying the angle.
* @return array An affine transformation matrix (an array with keys
* @return array{0:float,1:float,2:float,3:float,4:float,5:float} An affine transformation matrix (an array with keys
* 0 to 5 and float values).
* @throws ImageException
*
Expand Down
10 changes: 5 additions & 5 deletions generated/imap.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function imap_append($imap_stream, string $mailbox, string $message, string $opt
*
* @param resource $imap_stream An IMAP stream returned by
* imap_open.
* @return object Returns the information in an object with following properties:
* @return \stdClass Returns the information in an object with following properties:
*
*
*
Expand Down Expand Up @@ -214,7 +214,7 @@ function imap_gc($imap_stream, int $caches): void
* @param int $subjectlength Number of characters for the fetchsubject property
* Must be greater than or equal to zero.
* @param string $defaulthost
* @return object Returns FALSE on error or, if successful, the information in an object with following properties:
* @return \stdClass Returns FALSE on error or, if successful, the information in an object with following properties:
*
*
*
Expand Down Expand Up @@ -419,7 +419,7 @@ function imap_gc($imap_stream, int $caches): void
* @throws ImapException
*
*/
function imap_headerinfo($imap_stream, int $msg_number, int $fromlength = 0, int $subjectlength = 0, ?string $defaulthost = null): object
function imap_headerinfo($imap_stream, int $msg_number, int $fromlength = 0, int $subjectlength = 0, string $defaulthost = null): object
{
error_clear_last();
$result = \imap_headerinfo($imap_stream, $msg_number, $fromlength, $subjectlength, $defaulthost);
Expand Down Expand Up @@ -536,7 +536,7 @@ function imap_mail(string $to, string $subject, string $message, string $additio
*
* @param resource $imap_stream An IMAP stream returned by
* imap_open.
* @return object Returns the information in an object with following properties:
* @return \stdClass Returns the information in an object with following properties:
*
* Mailbox properties
*
Expand Down Expand Up @@ -835,7 +835,7 @@ function imap_num_msg($imap_stream): int
* @throws ImapException
*
*/
function imap_open(string $mailbox, string $username, string $password, int $options = 0, int $n_retries = 0, array $params = null)
function imap_open(string $mailbox, string $username, string $password, int $options = 0, int $n_retries = 0, ?array $params = null)
{
error_clear_last();
$result = \imap_open($mailbox, $username, $password, $options, $n_retries, $params);
Expand Down
11 changes: 2 additions & 9 deletions generated/info.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,6 @@ function cli_set_process_title(string $title): void
* /usr/local/php/lib/php/extensions/debug-non-zts-20010901
* or
* /usr/local/php/lib/php/extensions/no-debug-zts-20010901.
* @return int Returns TRUE on success. If the functionality of loading modules is not available
* or has been disabled (either by setting
* enable_dl off or by enabling safe mode
* in php.ini) an E_ERROR is emitted
* and execution is stopped. If dl fails because the
* specified library couldn't be loaded, in addition to FALSE an
* E_WARNING message is emitted.
* @throws InfoException
*
*/
Expand Down Expand Up @@ -266,7 +259,7 @@ function getmyuid(): int
*
* @param string $options
* @param array $longopts
* @param int $optind
* @param int|null $optind
* @return array|array|array This function will return an array of option / argument pairs.
* @throws InfoException
*
Expand Down Expand Up @@ -322,7 +315,7 @@ function ini_get(string $varname): string
* @throws InfoException
*
*/
function ini_set(string $varname, string $newvalue): string
function ini_set(string $varname, $newvalue): string
{
error_clear_last();
$result = \ini_set($varname, $newvalue);
Expand Down
Loading