Skip to content

Commit

Permalink
Merge a148f63 into 22f63e2
Browse files Browse the repository at this point in the history
  • Loading branch information
Kharhamel committed Dec 12, 2019
2 parents 22f63e2 + a148f63 commit 95dd7aa
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 78 deletions.
2 changes: 1 addition & 1 deletion generated/filesystem.php
Expand Up @@ -953,7 +953,7 @@ function fwrite($handle, string $string, int $length = null): int
*
*
*
* * - Matches zero of more characters.
* * - Matches zero or more characters.
*
*
*
Expand Down
3 changes: 2 additions & 1 deletion generated/functionsList.php
Expand Up @@ -370,7 +370,6 @@
'imap_undelete',
'imap_unsubscribe',
'imap_utf8_to_mutf7',
'assert_options',
'cli_set_process_title',
'dl',
'getlastmod',
Expand Down Expand Up @@ -486,6 +485,7 @@
'mb_parse_str',
'mb_regex_encoding',
'mb_send_mail',
'mb_split',
'define',
'highlight_file',
'highlight_string',
Expand Down Expand Up @@ -1017,6 +1017,7 @@
'md5_file',
'metaphone',
'sha1_file',
'soundex',
'sprintf',
'substr',
'vsprintf',
Expand Down
72 changes: 0 additions & 72 deletions generated/info.php
Expand Up @@ -4,78 +4,6 @@

use Safe\Exceptions\InfoException;

/**
* Set the various assert control options or just query
* their current settings.
*
* @param int $what
* Assert Options
*
*
*
* Option
* INI Setting
* Default value
* Description
*
*
*
*
* ASSERT_ACTIVE
* assert.active
* 1
* enable assert evaluation
*
*
* ASSERT_WARNING
* assert.warning
* 1
* issue a PHP warning for each failed assertion
*
*
* ASSERT_BAIL
* assert.bail
* 0
* terminate execution on failed assertions
*
*
* ASSERT_QUIET_EVAL
* assert.quiet_eval
* 0
*
* disable error_reporting during assertion expression
* evaluation
*
*
*
* ASSERT_CALLBACK
* assert.callback
* (NULL)
* Callback to call on failed assertions
*
*
*
*
* @param mixed $value An optional new value for the option.
* @return mixed Returns the original setting of any options.
* @throws InfoException
*
*/
function assert_options(int $what, $value = null)
{
error_clear_last();
if ($value !== null) {
$result = \assert_options($what, $value);
} else {
$result = \assert_options($what);
}
if ($result === false) {
throw InfoException::createFromPhpError();
}
return $result;
}


/**
* Sets the process title visible in tools such as top and
* ps. This function is available only in
Expand Down
21 changes: 21 additions & 0 deletions generated/mbstring.php
Expand Up @@ -472,3 +472,24 @@ function mb_send_mail(string $to, string $subject, string $message, string $addi
throw MbstringException::createFromPhpError();
}
}


/**
*
*
* @param string $pattern The regular expression pattern.
* @param string $string The string being split.
* @param int $limit
* @return array The result as an array.
* @throws MbstringException
*
*/
function mb_split(string $pattern, string $string, int $limit = -1): array
{
error_clear_last();
$result = \mb_split($pattern, $string, $limit);
if ($result === false) {
throw MbstringException::createFromPhpError();
}
return $result;
}
4 changes: 2 additions & 2 deletions generated/password.php
Expand Up @@ -97,7 +97,7 @@
* algorithm, will result
* in the password parameter being truncated to a
* maximum length of 72 characters.
* @param int $algo A password algorithm constant denoting the algorithm to use when hashing the password.
* @param int|string|null $algo A password algorithm constant denoting the algorithm to use when hashing the password.
* @param array $options An associative array containing options. See the password algorithm constants for documentation on the supported options for each algorithm.
*
* If omitted, a random salt will be created and the default cost will be
Expand All @@ -111,7 +111,7 @@
* @throws PasswordException
*
*/
function password_hash(string $password, int $algo, array $options = null): string
function password_hash(string $password, $algo, array $options = null): string
{
error_clear_last();
if ($options !== null) {
Expand Down
31 changes: 30 additions & 1 deletion generated/strings.php
Expand Up @@ -144,6 +144,35 @@ function sha1_file(string $filename, bool $raw_output = false): string
}


/**
* Calculates the soundex key of str.
*
* Soundex keys have the property that words pronounced similarly
* produce the same soundex key, and can thus be used to simplify
* searches in databases where you know the pronunciation but not
* the spelling. This soundex function returns a string 4 characters
* long, starting with a letter.
*
* This particular soundex function is one described by Donald Knuth
* in "The Art Of Computer Programming, vol. 3: Sorting And
* Searching", Addison-Wesley (1973), pp. 391-392.
*
* @param string $str The input string.
* @return string Returns the soundex key as a string.
* @throws StringsException
*
*/
function soundex(string $str): string
{
error_clear_last();
$result = \soundex($str);
if ($result === false) {
throw StringsException::createFromPhpError();
}
return $result;
}


/**
* Returns a string produced according to the formatting string
* format.
Expand Down Expand Up @@ -451,7 +480,7 @@ function sprintf(string $format, ...$params): string
* Returns the portion of string specified by the
* start and length parameters.
*
* @param string $string The input string. Must be one character or longer.
* @param string $string The input string.
* @param int $start If start is non-negative, the returned string
* will start at the start'th position in
* string, counting from zero. For instance,
Expand Down
Expand Up @@ -12,4 +12,5 @@
'gmp_random_seed' => ['void', 'seed'=>'GMP|string|int'], //gmp_random_seed doesn't return
'imageconvolution' => ['bool', 'src_im'=>'resource', 'matrix3x3'=>'array', 'div'=>'float', 'offset'=>'float'], //imageconvolution return a bool
'iptcembed' => ['string|bool', 'iptcdata'=>'string', 'jpeg_file_name'=>'string', 'spool='=>'int'], //iptcembed return either a string, true or false
'password_hash' => ['string|false', 'password'=>'string', 'algo'=>'int|string|null', 'options='=>'array'],
];
3 changes: 2 additions & 1 deletion rector-migrate.yml
Expand Up @@ -372,7 +372,6 @@ services:
imap_undelete: 'Safe\imap_undelete'
imap_unsubscribe: 'Safe\imap_unsubscribe'
imap_utf8_to_mutf7: 'Safe\imap_utf8_to_mutf7'
assert_options: 'Safe\assert_options'
cli_set_process_title: 'Safe\cli_set_process_title'
dl: 'Safe\dl'
getlastmod: 'Safe\getlastmod'
Expand Down Expand Up @@ -488,6 +487,7 @@ services:
mb_parse_str: 'Safe\mb_parse_str'
mb_regex_encoding: 'Safe\mb_regex_encoding'
mb_send_mail: 'Safe\mb_send_mail'
mb_split: 'Safe\mb_split'
define: 'Safe\define'
highlight_file: 'Safe\highlight_file'
highlight_string: 'Safe\highlight_string'
Expand Down Expand Up @@ -1019,6 +1019,7 @@ services:
md5_file: 'Safe\md5_file'
metaphone: 'Safe\metaphone'
sha1_file: 'Safe\sha1_file'
soundex: 'Safe\soundex'
sprintf: 'Safe\sprintf'
substr: 'Safe\substr'
vsprintf: 'Safe\vsprintf'
Expand Down

0 comments on commit 95dd7aa

Please sign in to comment.