I've got same warning in LibraryDiscoveryParser->buildByExtension(). The reason was that one of custom module's *.libraries.yml file contained an irrcorrectly defined js assets attribute - without any items stated in it below, valid way would be to remove such attribute from *.libraries.yml at all, or define it as an empty array:
js: {}
so, the issue was caused because of next lines in *.libraries.yml file:
js:
dependencies:
- core/ckeditor5
which caused next situation for LibraryDiscoveryParser:
and this enumeration in method buildByExtension()
does not expect such a case:
foreach ($library[$type] as $source => $options) {
The simplest way to avoid such warnings would be to maintain a correct/recommended *.libraries.yml files structure within your custom modules. I don't see the point here in making any code adjustments/patches on the maintainer side, unless they wish to add a workaround for such cases. :)