Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ext-ftp incorrect since PHP 8.1 #411

Open
jack-worman opened this issue Mar 2, 2023 · 2 comments
Open

ext-ftp incorrect since PHP 8.1 #411

jack-worman opened this issue Mar 2, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@jack-worman
Copy link

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 {}
@mvhirsch
Copy link

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

@staabm staabm added the bug Something isn't working label Nov 28, 2024
@staabm
Copy link
Collaborator

staabm commented Nov 29, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants