-
Notifications
You must be signed in to change notification settings - Fork 7.9k
implode() refers to wrong parameter name #9667
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
Comments
Is it likely that |
^ is correct: The message also incorrectly cites a "$pieces" parameter. IIRC this was an old name for it - the docs call it "$array" now. So NAB in the sense that flysystem is not properly checking the return value of However there's room for improvement here on the PHP side: mostly in the error message (such as fixing the parameter name) to help indicate what happened. IMO the proper fix is to change behavior based on the number of arguments passed, rather than the legacy style of checking if a parameter is null, but that would have to wait until PHP 9. Until then, the pieces-is-null-but-was-passed-as-an-argument condition could be checked and result in a slightly different message. |
I fully agree with @damianwadley here, except for:
In my opinion, we should fade out all function overloads in the long run; they are confusing at best, and always have issues regarding the implementation (ZPP and stubs). So I'd rather deprecate calling the function with a single argument. |
Oh yeah, if that's an option then definitely. Let's leave the unusual signatures like |
Lol. JS have less weirdness in arguments than PHP... |
Should be resolved by #12683 |
Description
The following code:
For complete file see: https://github.com/thephpleague/flysystem/blob/1.x/src/Adapter/Ftp.php#L577
Resulted in this output:
But I expected this output instead:
Apparently the native
ftp_raw
method returns astring
as return value instead ofarray|null
.Setting the connection configuration
passive = true
fixes the issue for now.But this kind of type errors should not occur.
Related to: thephpleague/flysystem#1481
PHP Version
PHP 8.0.19
Operating System
CentOS Linux release 7.9.2009 (Core)
The text was updated successfully, but these errors were encountered: