Scanning empty directories throws an error

I have a src directory with no .php files. Then I get the following error in my Mac:

 scandir(/.DocumentRevisions-V100): failed to open dir

I noticed the problem happens in this piece of code:

// File: PSR4/PSR4NamespaceFactory.php
$directories = array_map(function($directory) {
    return realpath($directory);
}, $directories);

which produces a $directories with value array(false). Then, simply adding an array_filter fixes the problem:

$directories = array_filter(array_map(function($directory) {
    return realpath($directory);
}, $directories));
Assignee Loading
Time tracking Loading