Closed tlvanknippenberg closed 3 years ago
Nice! I was planning to take care of this but you were faster. Looks good to me. :-)
@tlvanknippenberg Thanks! You currently do not have your GPG key uploaded into your account, so your commits show up as Unverified
, do you want to fix that? It's not that important, because I'll squash on merge anyway.
We could also make it compatible with both, I guess? Check whether the new function exists and fallback to the old one?
You currently do not have your GPG key uploaded into your account, so your commits show up as Unverified, do you want to fix that?
Good point. I have added keys to my account for future commits. Thanks!
Regarding the backwards compatibility, would something like this be acceptable? (line 38)
$files = yield method_exists(File::class, 'listFiles')
? File\listFiles($directory)
: File\scandir($directory);
@tlvanknippenberg Yes, exactly, but we'll need function_exists('Amp\File\listFiles') ? ... : ...
, as it's not a method.
Thanks!
I have taken the liberty of updating FileCache.php to be inline with the v2 amphp/file methods.
(This is the first time in a long while since I've contributed anything to OSS. Please let me know if I have missed anything.)