Skip to content
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
23 changes: 0 additions & 23 deletions generated/funchand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,6 @@

use Safe\Exceptions\FunchandException;

/**
* Creates a function dynamically from the parameters passed, and returns a unique name for it.
*
* @param string $args The function arguments, as a single comma-separated string.
* @param string $code The function code.
* @return string Returns a unique function name as a string.
* Note that the name contains a non-printable character ("\0"),
* so care should be taken when printing the name or incorporating it in any other
* string.
* @throws FunchandException
*
*/
function create_function(string $args, string $code): string
{
error_clear_last();
$safeResult = \create_function($args, $code);
if ($safeResult === false) {
throw FunchandException::createFromPhpError();
}
return $safeResult;
}


/**
*
*
Expand Down
5 changes: 0 additions & 5 deletions generated/functionsList.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
'com_print_typeinfo',
'convert_uudecode',
'copy',
'create_function',
'cubrid_bind',
'cubrid_column_names',
'cubrid_column_types',
Expand Down Expand Up @@ -256,7 +255,6 @@
'gzencode',
'gzfile',
'gzgets',
'gzgetss',
'gzinflate',
'gzopen',
'gzread',
Expand Down Expand Up @@ -295,7 +293,6 @@
'iconv_get_encoding',
'iconv_set_encoding',
'idate',
'image2wbmp',
'imageaffine',
'imageaffinematrixconcat',
'imageaffinematrixget',
Expand Down Expand Up @@ -432,7 +429,6 @@
'inotify_rm_watch',
'iptcembed',
'iptcparse',
'jpeg2wbmp',
'json_decode',
'json_encode',
'lchgrp',
Expand Down Expand Up @@ -710,7 +706,6 @@
'pg_trace',
'pg_update',
'php_sapi_name',
'png2wbmp',
'posix_access',
'posix_eaccess',
'posix_getgrgid',
Expand Down
72 changes: 0 additions & 72 deletions generated/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,36 +98,6 @@ function image_type_to_extension(int $image_type, bool $include_dot = true): str
}


/**
* image2wbmp outputs or save a WBMP
* version of the given image.
*
* @param resource $image An image resource, returned by one of the image creation functions,
* such as imagecreatetruecolor.
* @param string|null $filename Path to the saved file. If not given, the raw image stream will be
* output directly.
* @param int $foreground You can set the foreground color with this parameter by setting an
* identifier obtained from imagecolorallocate.
* The default foreground color is black.
* @throws ImageException
*
*/
function image2wbmp($image, ?string $filename = null, ?int $foreground = null): void
{
error_clear_last();
if ($foreground !== null) {
$safeResult = \image2wbmp($image, $filename, $foreground);
} elseif ($filename !== null) {
$safeResult = \image2wbmp($image, $filename);
} else {
$safeResult = \image2wbmp($image);
}
if ($safeResult === false) {
throw ImageException::createFromPhpError();
}
}


/**
*
*
Expand Down Expand Up @@ -2904,45 +2874,3 @@ function iptcparse(string $iptc_block): array
}
return $safeResult;
}


/**
* Converts a JPEG file into a WBMP file.
*
* @param string $jpegname Path to JPEG file.
* @param string $wbmpname Path to destination WBMP file.
* @param int $dest_height Destination image height.
* @param int $dest_width Destination image width.
* @param int $threshold Threshold value, between 0 and 8 (inclusive).
* @throws ImageException
*
*/
function jpeg2wbmp(string $jpegname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void
{
error_clear_last();
$safeResult = \jpeg2wbmp($jpegname, $wbmpname, $dest_height, $dest_width, $threshold);
if ($safeResult === false) {
throw ImageException::createFromPhpError();
}
}


/**
* Converts a PNG file into a WBMP file.
*
* @param string $pngname Path to PNG file.
* @param string $wbmpname Path to destination WBMP file.
* @param int $dest_height Destination image height.
* @param int $dest_width Destination image width.
* @param int $threshold Threshold value, between 0 and 8 (inclusive).
* @throws ImageException
*
*/
function png2wbmp(string $pngname, string $wbmpname, int $dest_height, int $dest_width, int $threshold): void
{
error_clear_last();
$safeResult = \png2wbmp($pngname, $wbmpname, $dest_height, $dest_width, $threshold);
if ($safeResult === false) {
throw ImageException::createFromPhpError();
}
}
29 changes: 0 additions & 29 deletions generated/zlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,35 +313,6 @@ function gzgets($stream, ?int $length = null): string
}


/**
* Identical to gzgets, except that
* gzgetss attempts to strip any HTML and PHP
* tags from the text it reads.
*
* @param resource $zp The gz-file pointer. It must be valid, and must point to a file
* successfully opened by gzopen.
* @param int $length The length of data to get.
* @param string $allowable_tags You can use this optional parameter to specify tags which should not
* be stripped.
* @return string The uncompressed and stripped string.
* @throws ZlibException
*
*/
function gzgetss($zp, int $length, ?string $allowable_tags = null): string
{
error_clear_last();
if ($allowable_tags !== null) {
$safeResult = \gzgetss($zp, $length, $allowable_tags);
} else {
$safeResult = \gzgetss($zp, $length);
}
if ($safeResult === false) {
throw ZlibException::createFromPhpError();
}
return $safeResult;
}


/**
* This function inflates a deflated string.
*
Expand Down
4 changes: 2 additions & 2 deletions generator/src/DocPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ private function getIsDeprecated(string $file): bool
if (preg_match('/&warn\.deprecated\.function-(\d+-\d+-\d+)\.removed-(\d+-\d+-\d+)/', $file, $matches)) {
$removedVersion = $matches[2];
[$major, $minor] = explode('-', $removedVersion);
if ($major < 7 || ($major == 7 && $minor == 0)) {
if ($major < 8 || ($major == 8 && $minor == 0)) {
return true;
}
}

if (preg_match('/&warn\.removed\.function-(\d+-\d+-\d+)/', $file, $matches)) {
$removedVersion = $matches[1];
[$major, $minor] = explode('-', $removedVersion);
if ($major < 7 || ($major == 7 && $minor == 0)) {
if ($major < 8 || ($major == 8 && $minor == 0)) {
return true;
}
}
Expand Down
6 changes: 3 additions & 3 deletions generator/src/Method.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ public function getParams(): array
if (preg_match('/This parameter has been removed in PHP (\d+\.\d+\.\d+)/', $notes, $matches)) {
$removedVersion = $matches[1];
[$major, $minor] = explode('.', $removedVersion);
if ($major < 7 || ($major == 7 && $minor == 0)) {
// Ignore parameter if it was removed before PHP 7.1
if ($major < 8 || ($major == 8 && $minor == 0)) {
// Ignore parameter if it was removed before PHP 8.1
continue;
}
}
Expand Down Expand Up @@ -136,7 +136,7 @@ private function stripReturnFalseText(string $string): string
$string = $this->removeString($string, ' and NULL on failure');
$string = $this->removeString($string, ' or NULL on failure');
break;

case self::FALSY_TYPE:
$string = $this->removeString($string, 'or FALSE on failure');
$string = $this->removeString($string, ', FALSE on failure');
Expand Down
2 changes: 0 additions & 2 deletions generator/tests/DocPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public function testDetectFalsyFunction(): void
$getCwd = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/dir/functions/getcwd.xml');
$createFromFormat = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/datetime/datetime/createfromformat.xml');
$filesize = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/filesystem/functions/filesize.xml');
$mcryptDecrypt = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/mcrypt/functions/mcrypt-decrypt.xml');
$fsockopen = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/network/functions/fsockopen.xml');
$arrayReplace = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/array/functions/array-replace.xml');
$classImplement = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/spl/functions/class-implements.xml');
Expand All @@ -28,7 +27,6 @@ public function testDetectFalsyFunction(): void
$this->assertTrue($getCwd->detectFalsyFunction());
$this->assertTrue($createFromFormat->detectFalsyFunction());
$this->assertTrue($filesize->detectFalsyFunction());
$this->assertTrue($mcryptDecrypt->detectFalsyFunction());
$this->assertTrue($fsockopen->detectFalsyFunction());
$this->assertFalse($arrayReplace->detectFalsyFunction());
$this->assertTrue($classImplement->detectFalsyFunction());
Expand Down
5 changes: 0 additions & 5 deletions rector-migrate.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
'com_print_typeinfo' => 'Safe\com_print_typeinfo',
'convert_uudecode' => 'Safe\convert_uudecode',
'copy' => 'Safe\copy',
'create_function' => 'Safe\create_function',
'cubrid_bind' => 'Safe\cubrid_bind',
'cubrid_column_names' => 'Safe\cubrid_column_names',
'cubrid_column_types' => 'Safe\cubrid_column_types',
Expand Down Expand Up @@ -263,7 +262,6 @@
'gzencode' => 'Safe\gzencode',
'gzfile' => 'Safe\gzfile',
'gzgets' => 'Safe\gzgets',
'gzgetss' => 'Safe\gzgetss',
'gzinflate' => 'Safe\gzinflate',
'gzopen' => 'Safe\gzopen',
'gzread' => 'Safe\gzread',
Expand Down Expand Up @@ -302,7 +300,6 @@
'iconv_get_encoding' => 'Safe\iconv_get_encoding',
'iconv_set_encoding' => 'Safe\iconv_set_encoding',
'idate' => 'Safe\idate',
'image2wbmp' => 'Safe\image2wbmp',
'imageaffine' => 'Safe\imageaffine',
'imageaffinematrixconcat' => 'Safe\imageaffinematrixconcat',
'imageaffinematrixget' => 'Safe\imageaffinematrixget',
Expand Down Expand Up @@ -439,7 +436,6 @@
'inotify_rm_watch' => 'Safe\inotify_rm_watch',
'iptcembed' => 'Safe\iptcembed',
'iptcparse' => 'Safe\iptcparse',
'jpeg2wbmp' => 'Safe\jpeg2wbmp',
'json_decode' => 'Safe\json_decode',
'json_encode' => 'Safe\json_encode',
'lchgrp' => 'Safe\lchgrp',
Expand Down Expand Up @@ -717,7 +713,6 @@
'pg_trace' => 'Safe\pg_trace',
'pg_update' => 'Safe\pg_update',
'php_sapi_name' => 'Safe\php_sapi_name',
'png2wbmp' => 'Safe\png2wbmp',
'posix_access' => 'Safe\posix_access',
'posix_eaccess' => 'Safe\posix_eaccess',
'posix_getgrgid' => 'Safe\posix_getgrgid',
Expand Down