Merge branch '2.7' into 2.8

* 2.7:
  added a comment about a workaround
  [Finder] no PHP warning on empty directory iteration
  fixed CS
This commit is contained in:
Fabien Potencier 2016-09-14 15:47:13 -07:00
commit 0ae3838dc6
2 changed files with 6 additions and 1 deletions

View File

@ -207,7 +207,7 @@ EOF
}
});
$output->writeln(json_encode($filesInfo, defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES : 0));
$output->writeln(json_encode($filesInfo, defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES : 0));
return min($errors, 1);
}

View File

@ -137,6 +137,11 @@ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator
return $this->rewindable;
}
// workaround for an HHVM bug, should be removed when https://github.com/facebook/hhvm/issues/7281 is fixed
if ('' === $this->getPath()) {
return $this->rewindable = false;
}
if (false !== $stream = @opendir($this->getPath())) {
$infos = stream_get_meta_data($stream);
closedir($stream);