diff --git a/generated/8.1/functionsList.php b/generated/8.1/functionsList.php index 2ec34c4a..b3c4aaaf 100644 --- a/generated/8.1/functionsList.php +++ b/generated/8.1/functionsList.php @@ -213,6 +213,7 @@ 'ftp_pasv', 'ftp_put', 'ftp_pwd', + 'ftp_raw', 'ftp_rename', 'ftp_rmdir', 'ftp_site', diff --git a/generated/8.1/rector-migrate.php b/generated/8.1/rector-migrate.php index 6fd91b65..a3a1ebf2 100644 --- a/generated/8.1/rector-migrate.php +++ b/generated/8.1/rector-migrate.php @@ -221,6 +221,7 @@ 'ftp_pasv' => 'Safe\ftp_pasv', 'ftp_put' => 'Safe\ftp_put', 'ftp_pwd' => 'Safe\ftp_pwd', + 'ftp_raw' => 'Safe\ftp_raw', 'ftp_rename' => 'Safe\ftp_rename', 'ftp_rmdir' => 'Safe\ftp_rmdir', 'ftp_site' => 'Safe\ftp_site', diff --git a/generated/8.2/ftp.php b/generated/8.2/ftp.php index 2c481228..ead4b0a7 100644 --- a/generated/8.2/ftp.php +++ b/generated/8.2/ftp.php @@ -411,28 +411,6 @@ function ftp_pwd(\FTP\Connection $ftp): string } -/** - * Sends an arbitrary command to the FTP server. - * - * @param \FTP\Connection $ftp An FTP\Connection instance. - * @param string $command The command to execute. - * @return array Returns the server's response as an array of strings. - * No parsing is performed on the response string, nor does - * ftp_raw determine if the command succeeded. - * @throws FtpException - * - */ -function ftp_raw(\FTP\Connection $ftp, string $command): array -{ - error_clear_last(); - $safeResult = \ftp_raw($ftp, $command); - if ($safeResult === null) { - throw FtpException::createFromPhpError(); - } - return $safeResult; -} - - /** * ftp_rename renames a file or a directory on the FTP * server. diff --git a/generated/8.3/ftp.php b/generated/8.3/ftp.php index 2c481228..ead4b0a7 100644 --- a/generated/8.3/ftp.php +++ b/generated/8.3/ftp.php @@ -411,28 +411,6 @@ function ftp_pwd(\FTP\Connection $ftp): string } -/** - * Sends an arbitrary command to the FTP server. - * - * @param \FTP\Connection $ftp An FTP\Connection instance. - * @param string $command The command to execute. - * @return array Returns the server's response as an array of strings. - * No parsing is performed on the response string, nor does - * ftp_raw determine if the command succeeded. - * @throws FtpException - * - */ -function ftp_raw(\FTP\Connection $ftp, string $command): array -{ - error_clear_last(); - $safeResult = \ftp_raw($ftp, $command); - if ($safeResult === null) { - throw FtpException::createFromPhpError(); - } - return $safeResult; -} - - /** * ftp_rename renames a file or a directory on the FTP * server. diff --git a/generated/8.4/ftp.php b/generated/8.4/ftp.php index a7393331..f5b87f06 100644 --- a/generated/8.4/ftp.php +++ b/generated/8.4/ftp.php @@ -441,28 +441,6 @@ function ftp_pwd(\FTP\Connection $ftp): string } -/** - * Sends an arbitrary command to the FTP server. - * - * @param \FTP\Connection $ftp An FTP\Connection instance. - * @param string $command The command to execute. - * @return array Returns the server's response as an array of strings. - * No parsing is performed on the response string, nor does - * ftp_raw determine if the command succeeded. - * @throws FtpException - * - */ -function ftp_raw(\FTP\Connection $ftp, string $command): array -{ - error_clear_last(); - $safeResult = \ftp_raw($ftp, $command); - if ($safeResult === null) { - throw FtpException::createFromPhpError(); - } - return $safeResult; -} - - /** * ftp_rename renames a file or a directory on the FTP * server. diff --git a/generated/8.5/ftp.php b/generated/8.5/ftp.php index a7393331..f5b87f06 100644 --- a/generated/8.5/ftp.php +++ b/generated/8.5/ftp.php @@ -441,28 +441,6 @@ function ftp_pwd(\FTP\Connection $ftp): string } -/** - * Sends an arbitrary command to the FTP server. - * - * @param \FTP\Connection $ftp An FTP\Connection instance. - * @param string $command The command to execute. - * @return array Returns the server's response as an array of strings. - * No parsing is performed on the response string, nor does - * ftp_raw determine if the command succeeded. - * @throws FtpException - * - */ -function ftp_raw(\FTP\Connection $ftp, string $command): array -{ - error_clear_last(); - $safeResult = \ftp_raw($ftp, $command); - if ($safeResult === null) { - throw FtpException::createFromPhpError(); - } - return $safeResult; -} - - /** * ftp_rename renames a file or a directory on the FTP * server. diff --git a/lib/special_cases.php b/lib/special_cases.php index dec26515..b416438e 100644 --- a/lib/special_cases.php +++ b/lib/special_cases.php @@ -9,6 +9,7 @@ namespace Safe; use Safe\Exceptions\ExecException; +use Safe\Exceptions\FtpException; use Safe\Exceptions\MiscException; use Safe\Exceptions\PosixException; use Safe\Exceptions\SocketsException; @@ -491,3 +492,25 @@ function hash_hmac_file(string $algo, string $filename, string $key, bool $binar } return $safeResult; } + +/** + * Sends an arbitrary command to the FTP server. + * + * @param \FTP\Connection $ftp An FTP\Connection instance. + * @param string $command The command to execute. + * @phpstan-return string[] + * @return array Returns the server's response as an array of strings. + * No parsing is performed on the response string, nor does + * ftp_raw determine if the command succeeded. + * @throws FtpException + * + */ +function ftp_raw(\FTP\Connection $ftp, string $command): array +{ + error_clear_last(); + $safeResult = \ftp_raw($ftp, $command); + if ($safeResult === null) { + throw FtpException::createFromPhpError(); + } + return $safeResult; +}