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

Updating functions list with new documentation #68

Merged
merged 5 commits into from
Jan 4, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"generated/msql.php",
"generated/mssql.php",
"generated/mysql.php",
"generated/mysqli.php",
"generated/mysqlndMs.php",
"generated/mysqlndQc.php",
"generated/network.php",
Expand All @@ -78,6 +79,7 @@
"generated/solr.php",
"generated/spl.php",
"generated/sqlsrv.php",
"generated/ssdeep.php",
"generated/ssh2.php",
"generated/stats.php",
"generated/stream.php",
Expand Down
6 changes: 6 additions & 0 deletions generated/Exceptions/MysqliException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
namespace Safe\Exceptions;

class MysqliException extends AbstractSafeException
{
}
6 changes: 6 additions & 0 deletions generated/Exceptions/SsdeepException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
namespace Safe\Exceptions;

class SsdeepException extends AbstractSafeException
{
}
36 changes: 36 additions & 0 deletions generated/array.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,42 @@ function array_multisort(array &$array1, $array1_sort_order = SORT_ASC, $array1_
}


/**
* Searches haystack for needle.
*
* @param mixed $needle The searched value.
*
* If needle is a string, the comparison is done
* in a case-sensitive manner.
* @param array $haystack The array.
* @param bool $strict If the third parameter strict is set to TRUE
* then the array_search function will search for
* identical elements in the
* haystack. This means it will also perform a
* strict type comparison of the
* needle in the haystack,
* and objects must be the same instance.
* @return int|string Returns the key for needle if it is found in the
* array, FALSE otherwise.
*
* If needle is found in haystack
* more than once, the first matching key is returned. To return the keys for
* all matching values, use array_keys with the optional
* search_value parameter instead.
* @throws ArrayException
*
*/
function array_search($needle, array $haystack, bool $strict = false)
{
error_clear_last();
$result = \array_search($needle, $haystack, $strict);
if ($result === false) {
throw ArrayException::createFromPhpError();
}
return $result;
}


/**
* Applies the user-defined callback function to each
* element of the array. This function will recurse
Expand Down
7 changes: 2 additions & 5 deletions generated/filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,8 @@ function fopen(string $filename, string $mode, bool $use_include_path = false, $
* @param string $enclosure The optional enclosure parameter sets the field
* enclosure (one character only).
* @param string $escape_char The optional escape_char parameter sets the
* escape character (one character only).
* escape character (at most one character).
* An empty string ("") disables the proprietary escape mechanism.
* @return int Returns the length of the written string .
* @throws FilesystemException
*
Expand Down Expand Up @@ -1305,10 +1306,6 @@ function tempnam(string $dir, string $prefix): string
* the file handle returned by tmpfile), or when the
* script ends.
*
* For details, consult your system documentation on the
* tmpfile(3) function, as well as the
* stdio.h header file.
*
* @return resource Returns a file handle, similar to the one returned by
* fopen, for the new file .
* @throws FilesystemException
Expand Down
49 changes: 49 additions & 0 deletions generated/filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,55 @@ function filter_has_var(int $type, string $variable_name): void
}


/**
* This function is useful for retrieving many values without
* repetitively calling filter_input.
*
* @param int $type One of INPUT_GET, INPUT_POST,
* INPUT_COOKIE, INPUT_SERVER, or
* INPUT_ENV.
* @param int|array $definition An array defining the arguments. A valid key is a string
* containing a variable name and a valid value is either a filter type, or an array
* optionally specifying the filter, flags and options. If the value is an
* array, valid keys are filter which specifies the
* filter type,
* flags which specifies any flags that apply to the
* filter, and options which specifies any options that
* apply to the filter. See the example below for a better understanding.
*
* This parameter can be also an integer holding a filter constant. Then all values in the
* input array are filtered by this filter.
* @param bool $add_empty Add missing keys as NULL to the return value.
* @return mixed An array containing the values of the requested variables on success.
* If the input array designated by type is not populated,
* the function returns NULL if the FILTER_NULL_ON_FAILURE
* flag is not given, or FALSE otherwise. For other failures, FALSE is returned.
*
* An array value will be FALSE if the filter fails, or NULL if
* the variable is not set. Or if the flag FILTER_NULL_ON_FAILURE
* is used, it returns FALSE if the variable is not set and NULL if the filter
* fails. If the add_empty parameter is FALSE, no array
* element will be added for unset variables.
* @throws FilterException
*
*/
function filter_input_array(int $type, $definition = null, bool $add_empty = true)
{
error_clear_last();
if ($add_empty !== true) {
$result = \filter_input_array($type, $definition, $add_empty);
} elseif ($definition !== null) {
$result = \filter_input_array($type, $definition);
} else {
$result = \filter_input_array($type);
}
if ($result === false) {
throw FilterException::createFromPhpError();
}
return $result;
}


/**
* This function is useful for retrieving many values without
* repetitively calling filter_var.
Expand Down
16 changes: 5 additions & 11 deletions generated/funchand.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,16 @@ function forward_static_call_array(callable $function, array $parameters)
* @param callable $function The function or method to be called. This parameter may be an array,
* with the name of the class, and the method, or a string, with a function
* name.
* @param mixed $parameter Zero or more parameters to be passed to the function.
* @param mixed $params
* @param mixed $params Zero or more parameters to be passed to the function.
* @return mixed Returns the function result, .
* @throws FunchandException
*
*/
function forward_static_call(callable $function, $parameter = null, ...$params)
function forward_static_call(callable $function, ...$params)
{
error_clear_last();
if ($params !== []) {
$result = \forward_static_call($function, $parameter, ...$params);
} elseif ($parameter !== null) {
$result = \forward_static_call($function, $parameter);
$result = \forward_static_call($function, ...$params);
} else {
$result = \forward_static_call($function);
}
Expand All @@ -115,18 +112,15 @@ function forward_static_call(callable $function, $parameter = null, ...$params)
*
* @param callable $function The function name as a string, or an array consisting of an object and
* a method.
* @param mixed $arg
* @param mixed $params
* @throws FunchandException
*
*/
function register_tick_function(callable $function, $arg = null, ...$params): void
function register_tick_function(callable $function, ...$params): void
{
error_clear_last();
if ($params !== []) {
$result = \register_tick_function($function, $arg, ...$params);
} elseif ($arg !== null) {
$result = \register_tick_function($function, $arg);
$result = \register_tick_function($function, ...$params);
} else {
$result = \register_tick_function($function);
}
Expand Down
28 changes: 27 additions & 1 deletion generated/functionsList.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
'apcu_sma_info',
'array_combine',
'array_multisort',
'array_search',
'array_walk_recursive',
'arsort',
'asort',
Expand Down Expand Up @@ -171,6 +172,7 @@
'touch',
'unlink',
'filter_has_var',
'filter_input_array',
'filter_var_array',
'fastcgi_finish_request',
'ftp_alloc',
Expand Down Expand Up @@ -296,8 +298,11 @@
'imageopenpolygon',
'imagepng',
'imagepolygon',
'imagepsencodefont',
'imagepsextendfont',
'imagepsfreefont',
'imagepsslantfont',
'imagerectangle',
'imageresolution',
'imagerotate',
'imagesavealpha',
'imagescale',
Expand Down Expand Up @@ -379,11 +384,14 @@
'inotify_rm_watch',
'json_encode',
'json_last_error_msg',
'ldap_add_ext',
'ldap_add',
'ldap_bind_ext',
'ldap_bind',
'ldap_control_paged_result_response',
'ldap_control_paged_result',
'ldap_count_entries',
'ldap_delete_ext',
'ldap_delete',
'ldap_exop_passwd',
'ldap_exop_whoami',
Expand All @@ -399,14 +407,18 @@
'ldap_get_values_len',
'ldap_get_values',
'ldap_list',
'ldap_mod_add_ext',
'ldap_mod_add',
'ldap_mod_del_ext',
'ldap_mod_del',
'ldap_mod_replace_ext',
'ldap_mod_replace',
'ldap_modify_batch',
'ldap_next_attribute',
'ldap_parse_exop',
'ldap_parse_result',
'ldap_read',
'ldap_rename_ext',
'ldap_rename',
'ldap_sasl_bind',
'ldap_search',
Expand All @@ -431,6 +443,7 @@
'event_priority_set',
'event_set',
'event_timer_set',
'libxml_get_last_error',
'libxml_set_external_entity_loader',
'lzf_compress',
'lzf_decompress',
Expand Down Expand Up @@ -486,6 +499,7 @@
'mssql_data_seek',
'mssql_field_length',
'mssql_field_name',
'mssql_field_seek',
'mssql_field_type',
'mssql_free_result',
'mssql_free_statement',
Expand Down Expand Up @@ -524,6 +538,8 @@
'mysql_tablename',
'mysql_thread_id',
'mysql_unbuffered_query',
'mysqli_get_cache_stats',
'mysqli_get_client_stats',
'mysqlnd_ms_dump_servers',
'mysqlnd_ms_fabric_select_global',
'mysqlnd_ms_fabric_select_shard',
Expand Down Expand Up @@ -568,8 +584,10 @@
'oci_rollback',
'oci_server_version',
'oci_set_action',
'oci_set_call_timeout',
'oci_set_client_identifier',
'oci_set_client_info',
'oci_set_db_operation',
'oci_set_edition',
'oci_set_module_name',
'oci_set_prefetch',
Expand Down Expand Up @@ -906,16 +924,22 @@
'spl_autoload_unregister',
'sqlsrv_begin_transaction',
'sqlsrv_cancel',
'sqlsrv_client_info',
'sqlsrv_close',
'sqlsrv_commit',
'sqlsrv_configure',
'sqlsrv_execute',
'sqlsrv_free_stmt',
'sqlsrv_get_field',
'sqlsrv_next_result',
'sqlsrv_num_fields',
'sqlsrv_num_rows',
'sqlsrv_prepare',
'sqlsrv_query',
'sqlsrv_rollback',
'ssdeep_fuzzy_compare',
'ssdeep_fuzzy_hash_filename',
'ssdeep_fuzzy_hash',
'ssh2_auth_agent',
'ssh2_auth_hostbased_file',
'ssh2_auth_password',
Expand Down Expand Up @@ -962,7 +986,9 @@
'convert_uudecode',
'convert_uuencode',
'hex2bin',
'md5_file',
'metaphone',
'sha1_file',
'sprintf',
'substr',
'swoole_async_write',
Expand Down