ddeboer/php-ssh — comment on commit d1db61c20d6eeef27b6d9279d72168158454b12f
File: src/Ssh/Sftp.php line 221
By Herzult:

You can simply write `return '.' !== $file && '..' !== $file;`