safe icon indicating copy to clipboard operation
safe copied to clipboard

ext-ftp incorrect since PHP 8.1

Open jack-worman opened this issue 2 years ago • 1 comments

ext-ftp no longer uses resources and now uses \FTP\Connection. But all the safe functions are type-hinted with resource.

Wrong:

/**
 * Sends an ALLO command to the remote FTP server to
 * allocate space for a file to be uploaded.
 *
 * @param resource $ftp An FTP\Connection instance.
 * @param int $size The number of bytes to allocate.
 * @param string|null $response A textual representation of the servers response will be returned by
 * reference in response if a variable is provided.
 * @throws FtpException
 *
 */
function ftp_alloc($ftp, int $size, ?string &$response = null): void {}

Correct:

/**
 * Sends an ALLO command to the remote FTP server to
 * allocate space for a file to be uploaded.
 *
 * @param \FTP\Connection $ftp An FTP\Connection instance.
 * @param int $size The number of bytes to allocate.
 * @param string|null $response A textual representation of the servers response will be returned by
 * reference in response if a variable is provided.
 * @throws FtpException
 *
 */
function ftp_alloc(\FTP\Connection $ftp, int $size, ?string &$response = null): void {}

jack-worman avatar Mar 02 '23 13:03 jack-worman

I just ran into the same issue. Is there a proper way to fix this?

mvhirsch avatar Sep 11 '24 15:09 mvhirsch

I guess this will be fixed as soon as we release a new version with min-php version 8.1

staabm avatar Nov 29 '24 09:11 staabm