See https://bugs.php.net/bug.php?id=68557
Since: 1.0
Author: Bernhard Schussek (bschussek@gmail.com)
Inheritance: implements RecursiveIterato\RecursiveIterator, implements SeekableIterato\SeekableIterator
 /**
  * {@inheritdoc}
  */
 public function hasChildren()
 {
     // Use attached repository if possible
     if ($this->getRepository()) {
         return $this->getRepository()->hasChildren($this->getRepositoryPath());
     }
     $iterator = new RecursiveDirectoryIterator($this->getFilesystemPath());
     $iterator->rewind();
     return $iterator->valid();
 }
 public function __construct($filesystemPath, $repositoryPath, $flags = null)
 {
     parent::__construct($filesystemPath, $flags);
     $this->repositoryPath = rtrim($repositoryPath, '/');
     $this->flags = $flags;
 }
 /**
  * {@inheritdoc}
  */
 public function hasChildren($path)
 {
     $filesystemPath = $this->getFilesystemPath($path);
     if (!is_dir($filesystemPath)) {
         return false;
     }
     $iterator = new RecursiveDirectoryIterator($filesystemPath);
     $iterator->rewind();
     return $iterator->valid();
 }