Skip to content

Commit

Permalink
Merge pull request #11 from moufmouf/fix_optional_no_default_value_issue
Browse files Browse the repository at this point in the history
Fixing a problem with optional with no default value parameters
  • Loading branch information
moufmouf committed Sep 6, 2018
2 parents 2392b5b + bc7a983 commit 7fc0829
Show file tree
Hide file tree
Showing 64 changed files with 203 additions and 203 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ script:
fi
after_script:
- travis_retry php vendor/bin/php-coveralls
- cd generator && travis_retry php vendor/bin/php-coveralls -v
4 changes: 2 additions & 2 deletions generated/bcompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function bcompiler_read($filehandle): void
* @throws Exceptions\BcompilerException
*
*/
function bcompiler_write_class($filehandle, string $className, string $extends): void
function bcompiler_write_class($filehandle, string $className, string $extends = null): void
{
error_clear_last();
if ($extends !== null) {
Expand Down Expand Up @@ -200,7 +200,7 @@ function bcompiler_write_functions_from_file($filehandle, string $fileName): voi
* @throws Exceptions\BcompilerException
*
*/
function bcompiler_write_header($filehandle, string $write_ver): void
function bcompiler_write_header($filehandle, string $write_ver = null): void
{
error_clear_last();
if ($write_ver !== null) {
Expand Down
2 changes: 1 addition & 1 deletion generated/bzip2.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function bzread($bz, int $length = 1024): string
* @throws Exceptions\Bzip2Exception
*
*/
function bzwrite($bz, string $data, int $length): int
function bzwrite($bz, string $data, int $length = null): int
{
error_clear_last();
if ($length !== null) {
Expand Down
4 changes: 2 additions & 2 deletions generated/com.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* @throws Exceptions\ComException
*
*/
function com_event_sink(variant $comobject, object $sinkobject, $sinkinterface): void
function com_event_sink(variant $comobject, object $sinkobject, $sinkinterface = null): void
{
error_clear_last();
if ($sinkinterface !== null) {
Expand Down Expand Up @@ -115,7 +115,7 @@ function com_load_typelib(string $typelib_name, bool $case_insensitive = true):
* @throws Exceptions\ComException
*
*/
function com_print_typeinfo(object $comobject, string $dispinterface, bool $wantsink = false): void
function com_print_typeinfo(object $comobject, string $dispinterface = null, bool $wantsink = false): void
{
error_clear_last();
if ($wantsink !== false) {
Expand Down
2 changes: 1 addition & 1 deletion generated/crack.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @throws Exceptions\CrackException
*
*/
function crack_closedict($dictionary): void
function crack_closedict($dictionary = null): void
{
error_clear_last();
if ($dictionary !== null) {
Expand Down
2 changes: 1 addition & 1 deletion generated/cyrus.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function cyrus_close($connection): void
* @throws Exceptions\CyrusException
*
*/
function cyrus_connect(string $host, string $port, int $flags)
function cyrus_connect(string $host = null, string $port = null, int $flags = null)
{
error_clear_last();
if ($flags !== null) {
Expand Down
4 changes: 2 additions & 2 deletions generated/dba.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function dba_nextkey($handle): string
* @throws Exceptions\DbaException
*
*/
function dba_open(string $path, string $mode, string $handler, ...$params)
function dba_open(string $path, string $mode, string $handler = null, ...$params)
{
error_clear_last();
if ($params !== null) {
Expand Down Expand Up @@ -262,7 +262,7 @@ function dba_optimize($handle): void
* @throws Exceptions\DbaException
*
*/
function dba_popen(string $path, string $mode, string $handler, ...$params)
function dba_popen(string $path, string $mode, string $handler = null, ...$params)
{
error_clear_last();
if ($params !== null) {
Expand Down
2 changes: 1 addition & 1 deletion generated/dbx.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
* @throws Exceptions\DbxException
*
*/
function dbx_connect($module, string $host, string $database, string $username, string $password, int $persistent): object
function dbx_connect($module, string $host, string $database, string $username, string $password, int $persistent = null): object
{
error_clear_last();
if ($persistent !== null) {
Expand Down
4 changes: 2 additions & 2 deletions generated/dir.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function chroot(string $directory): void
* @throws Exceptions\DirException
*
*/
function readdir($dir_handle): string
function readdir($dir_handle = null): string
{
error_clear_last();
if ($dir_handle !== null) {
Expand All @@ -83,7 +83,7 @@ function readdir($dir_handle): string
* @throws Exceptions\DirException
*
*/
function rewinddir($dir_handle): void
function rewinddir($dir_handle = null): void
{
error_clear_last();
if ($dir_handle !== null) {
Expand Down
8 changes: 4 additions & 4 deletions generated/eio.php
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ function eio_fdatasync($fd, int $pri = EIO_PRI_DEFAULT, callable $callback = NUL
* @throws Exceptions\EioException
*
*/
function eio_fstat($fd, int $pri, callable $callback, $data)
function eio_fstat($fd, int $pri, callable $callback, $data = null)
{
error_clear_last();
if ($data !== null) {
Expand Down Expand Up @@ -550,7 +550,7 @@ function eio_fstat($fd, int $pri, callable $callback, $data)
* @throws Exceptions\EioException
*
*/
function eio_fstatvfs($fd, int $pri, callable $callback, $data)
function eio_fstatvfs($fd, int $pri, callable $callback, $data = null)
{
error_clear_last();
if ($data !== null) {
Expand Down Expand Up @@ -1567,7 +1567,7 @@ function eio_seek($fd, int $offset, int $whence, int $pri = EIO_PRI_DEFAULT, cal
* @throws Exceptions\EioException
*
*/
function eio_sendfile($out_fd, $in_fd, int $offset, int $length, int $pri, callable $callback, string $data)
function eio_sendfile($out_fd, $in_fd, int $offset, int $length, int $pri = null, callable $callback = null, string $data = null)
{
error_clear_last();
if ($data !== null) {
Expand Down Expand Up @@ -1675,7 +1675,7 @@ function eio_stat(string $path, int $pri, callable $callback, $data = NULL)
* @throws Exceptions\EioException
*
*/
function eio_statvfs(string $path, int $pri, callable $callback, $data)
function eio_statvfs(string $path, int $pri, callable $callback, $data = null)
{
error_clear_last();
if ($data !== null) {
Expand Down
2 changes: 1 addition & 1 deletion generated/fam.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function fam_monitor_file($fam, string $filename)
* @throws Exceptions\FamException
*
*/
function fam_open(string $appname)
function fam_open(string $appname = null)
{
error_clear_last();
if ($appname !== null) {
Expand Down
34 changes: 17 additions & 17 deletions generated/fbsql.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @throws Exceptions\FbsqlException
*
*/
function fbsql_blob_size(string $blob_handle, $link_identifier): int
function fbsql_blob_size(string $blob_handle, $link_identifier = null): int
{
error_clear_last();
if ($link_identifier !== null) {
Expand Down Expand Up @@ -53,7 +53,7 @@ function fbsql_blob_size(string $blob_handle, $link_identifier): int
* @throws Exceptions\FbsqlException
*
*/
function fbsql_change_user(string $user, string $password, string $database, $link_identifier): void
function fbsql_change_user(string $user, string $password, string $database = null, $link_identifier = null): void
{
error_clear_last();
if ($link_identifier !== null) {
Expand Down Expand Up @@ -85,7 +85,7 @@ function fbsql_change_user(string $user, string $password, string $database, $li
* @throws Exceptions\FbsqlException
*
*/
function fbsql_clob_size(string $clob_handle, $link_identifier): int
function fbsql_clob_size(string $clob_handle, $link_identifier = null): int
{
error_clear_last();
if ($link_identifier !== null) {
Expand Down Expand Up @@ -119,7 +119,7 @@ function fbsql_clob_size(string $clob_handle, $link_identifier): int
* @throws Exceptions\FbsqlException
*
*/
function fbsql_close($link_identifier): void
function fbsql_close($link_identifier = null): void
{
error_clear_last();
if ($link_identifier !== null) {
Expand Down Expand Up @@ -149,7 +149,7 @@ function fbsql_close($link_identifier): void
* @throws Exceptions\FbsqlException
*
*/
function fbsql_commit($link_identifier): void
function fbsql_commit($link_identifier = null): void
{
error_clear_last();
if ($link_identifier !== null) {
Expand Down Expand Up @@ -210,7 +210,7 @@ function fbsql_connect(string $hostname = null, string $username = null, string
* @throws Exceptions\FbsqlException
*
*/
function fbsql_create_db(string $database_name, $link_identifier, string $database_options): void
function fbsql_create_db(string $database_name, $link_identifier = null, string $database_options = null): void
{
error_clear_last();
if ($database_options !== null) {
Expand Down Expand Up @@ -269,7 +269,7 @@ function fbsql_data_seek($result, int $row_number): void
* @throws Exceptions\FbsqlException
*
*/
function fbsql_db_query(string $database, string $query, $link_identifier)
function fbsql_db_query(string $database, string $query, $link_identifier = null)
{
error_clear_last();
if ($link_identifier !== null) {
Expand Down Expand Up @@ -300,7 +300,7 @@ function fbsql_db_query(string $database, string $query, $link_identifier)
* @throws Exceptions\FbsqlException
*
*/
function fbsql_drop_db(string $database_name, $link_identifier): void
function fbsql_drop_db(string $database_name, $link_identifier = null): void
{
error_clear_last();
if ($link_identifier !== null) {
Expand Down Expand Up @@ -356,7 +356,7 @@ function fbsql_drop_db(string $database_name, $link_identifier): void
* @throws Exceptions\FbsqlException
*
*/
function fbsql_fetch_field($result, int $field_offset): object
function fbsql_fetch_field($result, int $field_offset = null): object
{
error_clear_last();
if ($field_offset !== null) {
Expand Down Expand Up @@ -410,7 +410,7 @@ function fbsql_fetch_lengths($result): array
* @throws Exceptions\FbsqlException
*
*/
function fbsql_field_seek($result, int $field_offset): void
function fbsql_field_seek($result, int $field_offset = null): void
{
error_clear_last();
if ($field_offset !== null) {
Expand Down Expand Up @@ -466,7 +466,7 @@ function fbsql_free_result($result): void
* @throws Exceptions\FbsqlException
*
*/
function fbsql_list_dbs($link_identifier)
function fbsql_list_dbs($link_identifier = null)
{
error_clear_last();
if ($link_identifier !== null) {
Expand Down Expand Up @@ -499,7 +499,7 @@ function fbsql_list_dbs($link_identifier)
* @throws Exceptions\FbsqlException
*
*/
function fbsql_list_fields(string $database_name, string $table_name, $link_identifier)
function fbsql_list_fields(string $database_name, string $table_name, $link_identifier = null)
{
error_clear_last();
if ($link_identifier !== null) {
Expand Down Expand Up @@ -532,7 +532,7 @@ function fbsql_list_fields(string $database_name, string $table_name, $link_iden
* @throws Exceptions\FbsqlException
*
*/
function fbsql_list_tables(string $database, $link_identifier)
function fbsql_list_tables(string $database, $link_identifier = null)
{
error_clear_last();
if ($link_identifier !== null) {
Expand Down Expand Up @@ -601,7 +601,7 @@ function fbsql_pconnect(string $hostname = null, string $username = null, string
* @throws Exceptions\FbsqlException
*
*/
function fbsql_rollback($link_identifier): void
function fbsql_rollback($link_identifier = null): void
{
error_clear_last();
if ($link_identifier !== null) {
Expand Down Expand Up @@ -644,7 +644,7 @@ function fbsql_rollback($link_identifier): void
* @throws Exceptions\FbsqlException
*
*/
function fbsql_select_db(string $database_name, $link_identifier): void
function fbsql_select_db(string $database_name = null, $link_identifier = null): void
{
error_clear_last();
if ($link_identifier !== null) {
Expand Down Expand Up @@ -750,7 +750,7 @@ function fbsql_set_password($link_identifier, string $user, string $password, st
* @throws Exceptions\FbsqlException
*
*/
function fbsql_start_db(string $database_name, $link_identifier, string $database_options): void
function fbsql_start_db(string $database_name, $link_identifier = null, string $database_options = null): void
{
error_clear_last();
if ($database_options !== null) {
Expand Down Expand Up @@ -781,7 +781,7 @@ function fbsql_start_db(string $database_name, $link_identifier, string $databas
* @throws Exceptions\FbsqlException
*
*/
function fbsql_stop_db(string $database_name, $link_identifier): void
function fbsql_stop_db(string $database_name, $link_identifier = null): void
{
error_clear_last();
if ($link_identifier !== null) {
Expand Down
6 changes: 3 additions & 3 deletions generated/fdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function fdf_save_string($fdf_document): string
* @throws Exceptions\FdfException
*
*/
function fdf_save($fdf_document, string $filename): void
function fdf_save($fdf_document, string $filename = null): void
{
error_clear_last();
if ($filename !== null) {
Expand Down Expand Up @@ -224,7 +224,7 @@ function fdf_set_encoding($fdf_document, string $encoding): void
* @throws Exceptions\FdfException
*
*/
function fdf_set_file($fdf_document, string $url, string $target_frame): void
function fdf_set_file($fdf_document, string $url, string $target_frame = null): void
{
error_clear_last();
if ($target_frame !== null) {
Expand Down Expand Up @@ -383,7 +383,7 @@ function fdf_set_target_frame($fdf_document, string $frame_name): void
* @throws Exceptions\FdfException
*
*/
function fdf_set_value($fdf_document, string $fieldname, $value, int $isName): void
function fdf_set_value($fdf_document, string $fieldname, $value, int $isName = null): void
{
error_clear_last();
if ($isName !== null) {
Expand Down
10 changes: 5 additions & 5 deletions generated/filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function chown(string $filename, $user): void
* @throws Exceptions\FilesystemException
*
*/
function copy(string $source, string $dest, $context): void
function copy(string $source, string $dest, $context = null): void
{
error_clear_last();
if ($context !== null) {
Expand Down Expand Up @@ -703,7 +703,7 @@ function ftruncate($handle, int $size): void
* @throws Exceptions\FilesystemException
*
*/
function fwrite($handle, string $string, int $length): int
function fwrite($handle, string $string, int $length = null): int
{
error_clear_last();
if ($length !== null) {
Expand Down Expand Up @@ -966,7 +966,7 @@ function readlink(string $path): string
* @throws Exceptions\FilesystemException
*
*/
function rename(string $oldname, string $newname, $context): void
function rename(string $oldname, string $newname, $context = null): void
{
error_clear_last();
if ($context !== null) {
Expand Down Expand Up @@ -1009,7 +1009,7 @@ function rewind($handle): void
* @throws Exceptions\FilesystemException
*
*/
function rmdir(string $dirname, $context): void
function rmdir(string $dirname, $context = null): void
{
error_clear_last();
if ($context !== null) {
Expand Down Expand Up @@ -1115,7 +1115,7 @@ function touch(string $filename, int $time = null, int $atime = null): void
* @throws Exceptions\FilesystemException
*
*/
function unlink(string $filename, $context): void
function unlink(string $filename, $context = null): void
{
error_clear_last();
if ($context !== null) {
Expand Down
2 changes: 1 addition & 1 deletion generated/ftp.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @throws Exceptions\FtpException
*
*/
function ftp_alloc($ftp_stream, int $filesize, string &$result): void
function ftp_alloc($ftp_stream, int $filesize, string &$result = null): void
{
error_clear_last();
if ($result !== null) {
Expand Down

0 comments on commit 7fc0829

Please sign in to comment.