diff --git a/generated/funchand.php b/generated/funchand.php index 18750f1c..1569f372 100644 --- a/generated/funchand.php +++ b/generated/funchand.php @@ -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; -} - - /** * * diff --git a/generated/functionsList.php b/generated/functionsList.php index 396c539d..11ec38d7 100644 --- a/generated/functionsList.php +++ b/generated/functionsList.php @@ -34,7 +34,6 @@ 'com_print_typeinfo', 'convert_uudecode', 'copy', - 'create_function', 'cubrid_bind', 'cubrid_column_names', 'cubrid_column_types', @@ -256,7 +255,6 @@ 'gzencode', 'gzfile', 'gzgets', - 'gzgetss', 'gzinflate', 'gzopen', 'gzread', @@ -295,7 +293,6 @@ 'iconv_get_encoding', 'iconv_set_encoding', 'idate', - 'image2wbmp', 'imageaffine', 'imageaffinematrixconcat', 'imageaffinematrixget', @@ -432,7 +429,6 @@ 'inotify_rm_watch', 'iptcembed', 'iptcparse', - 'jpeg2wbmp', 'json_decode', 'json_encode', 'lchgrp', @@ -710,7 +706,6 @@ 'pg_trace', 'pg_update', 'php_sapi_name', - 'png2wbmp', 'posix_access', 'posix_eaccess', 'posix_getgrgid', diff --git a/generated/image.php b/generated/image.php index daa62511..cafafd4f 100644 --- a/generated/image.php +++ b/generated/image.php @@ -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(); - } -} - - /** * * @@ -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(); - } -} diff --git a/generated/zlib.php b/generated/zlib.php index 8a85a9dd..f5e79df5 100644 --- a/generated/zlib.php +++ b/generated/zlib.php @@ -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. * diff --git a/generator/src/DocPage.php b/generator/src/DocPage.php index f0aa002c..88898500 100644 --- a/generator/src/DocPage.php +++ b/generator/src/DocPage.php @@ -19,7 +19,7 @@ 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; } } @@ -27,7 +27,7 @@ private function getIsDeprecated(string $file): bool 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; } } diff --git a/generator/src/Method.php b/generator/src/Method.php index b7bb5180..3291dd41 100644 --- a/generator/src/Method.php +++ b/generator/src/Method.php @@ -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; } } @@ -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'); diff --git a/generator/tests/DocPageTest.php b/generator/tests/DocPageTest.php index 842d932e..5ba339d9 100644 --- a/generator/tests/DocPageTest.php +++ b/generator/tests/DocPageTest.php @@ -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'); @@ -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()); diff --git a/rector-migrate.php b/rector-migrate.php index c7008e0b..a1bf2d7d 100644 --- a/rector-migrate.php +++ b/rector-migrate.php @@ -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', @@ -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', @@ -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', @@ -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', @@ -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',