Skip to content

Fix return type of ftp_mlsd#77

Open
patrickrobrecht wants to merge 1 commit intoNicolab:masterfrom
patrickrobrecht:fix-ftp_mlsd-return-type
Open

Fix return type of ftp_mlsd#77
patrickrobrecht wants to merge 1 commit intoNicolab:masterfrom
patrickrobrecht:fix-ftp_mlsd-return-type

Conversation

@patrickrobrecht
Copy link

FtpClient::mlsd calls FtpWrapper::mlsd whichs calls ftp_mlsd which returns array|false (see manual for ftp_mlsd).

As the return type is in PHPDoc only, this does not affect runtime, but leads to wrong results within static analysis. For example, PHPStan reports an error in the following code suggested that the check is not necessary:

        $list = $this->ftp->mlsd($directoryName);
        /** @phpstan-ignore-next-line identical.alwaysFalse calls ftp_mlsd which returns false in case of errors */
        if ($list === false) {
            return [];
        }

@patrickrobrecht patrickrobrecht force-pushed the fix-ftp_mlsd-return-type branch from cacda2d to baede2a Compare January 23, 2026 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant