- πΊπΈUnited States tedfordgif
It definitely looks like an error would have been thrown and logged: SplFileObject->fgets() calls spl_filesystem_file_read_ex() with silent == false, which will throw a PHP exception if the file can't be read.
That's the only place in the PHP source I see "Cannot read from file", so if we found that in logs it would be pretty clear.
As to how that can happen in ExtensionDiscovery::scanDirectory(), I'd look for race conditions if we're running tests in parallel, or some other filesystem failure (network filesystem, running out of disk space, ...).
@alexpott the assumption would seem to be that having a reference to an open SplFileObject (with a recent !eof check, no less) means you can read it without errors. That seems like a reasonable assumption to me, and matches most of the usage examples I've seen. However, perhaps we should consider adding a call to SplFileInfo->isReadable() before calling openFile(), and maybe logging our own error if not. There may be some minor performance implication if isReadable() and openFile() don't share a cache.
I also find the differences between SplFileObject::eof() and ::valid interesting, although the latter is billed as !eof.