( excerpt from
http://docs.hhvm.com/manual/en/recursivedirectoryiterator.haschildren.php )


@return     mixed   Returns whether the current entry is a directory,
but not '.' or '..'
189391
public function hasChildren()
    {
        if ($this->isDot()) {
            return false;
        }
        if (is_link($this->getPathname()) && !($this->flags & self::FOLLOW_SYMLINKS)) {
            return false;
        }
        return $this->isDir();
    }
1032695
public function checkDirectory(): bool
    {
        if ($this->directory == null) {
            throw new LoggerException('Log directory is not defined yet');
        }

        self::$directoryChecked = self::$directoryChecked ?: is_dir($this->directory);
        if (!self::$directoryChecked) {
            self::$directoryChecked = (bool) @mkdir($this->directory, 0644, true);
            if (self::$directoryChecked === false) {
                throw new LoggerException(sprintf('Cannot make directory, error[%s]',
                    error_get_last()['message'] ?? 'Unknown'));
            }
        }

        return self::$directoryChecked;
    }
23358
public function has_items() {
        if ($this->duringinstall) {
            return false;
        } else if ($this->hasitems !== false) {
            return true;
        }
        if (count($this->children) > 0 || count($this->prependchildren) > 0) {
            // There have been manually added items - there are definitely items.
            $outcome = true;
        } else if (!$this->ignoreactive) {
            // We will need to initialise the navigation structure to check if there are active items.
            $this->page->navigation->initialise($this->page);
            $outcome = ($this->page->navigation->contains_active_node() || $this->page->settingsnav->contains_active_node());
        }
        $this->hasitems = $outcome;
        return $outcome;
    }
1329686
public boolean isDirectory() throws SmbException {
        if( getUncPath0().length() == 1 ) {
            return true;
        }
        if (!exists()) return false;
        return ( attributes & ATTR_DIRECTORY ) == ATTR_DIRECTORY;
    }
1363917
public function hasRootAccess()
    {
        $path = '/root/.' . md5('_radic-cli-perm-test' . time());
        $root = (@file_put_contents($path, '1') === false ? false : true);
        if ($root !== false) {
            $this->getLaravel()->make('files')->delete($path);
        }

        return $root !== false;
    }
1310329
public function prev()
    {

        $index = $this->parent->indexOf($this) - 1;

        return isset($this->parent->children[$index]) ? $this->parent->children[$index] : null;
    }
810953
public static function get_directory_for_current_subsite()
    {
        $subsite = Subsite::currentSubsite();
        if ($subsite) {
            if ((int) $subsite->AssetsFolderID > 0) {
                $dirObj = $subsite->AssetsFolder();

                $dirName = str_replace('assets/', '', $dirObj->Filename);

                //make sure we've got no trailing slashes
                $dirName = str_replace('/', '', $dirName);

                return $dirName;
            }
        } else {
            return false;
        }
    }
1359576
public function isDir($directory)
    {
        $pwd = $this->ftp->pwd();

        if ($pwd === false) {
            throw new FtpException('Unable to resolve the current directory');
        }

        if (@$this->ftp->chdir($directory)) {
            $this->ftp->chdir($pwd);
            return true;
        }

        $this->ftp->chdir($pwd);

        return false;
    }
1048262
public function isAbsolutePathReference():bool{
		return $this->getScheme() === '' && $this->getAuthority() === '' && isset($this->getPath()[0]) && $this->getPath()[0] === '/';
	}
856138
protected function checkDirectory()
    {
        $directoryPath = $this
            ->directory
            ->getDirectoryPath();

        if (!is_dir($directoryPath)) {

            mkdir($directoryPath);
        }

        return $this;
    }
111541
public function isDirectory($path)
    {
        // The root is always a directory
        if($path == '/') {
            return true;
        }
        $parentDir = $this->dirname($path);
        return in_array($path, $this->directories($parentDir));
    }
1108995
private function isHierarchical()
    {
        $dataDefinition  = $this->environment->getDataDefinition();
        $basicDefinition = $dataDefinition->getBasicDefinition();

        return $basicDefinition::MODE_HIERARCHICAL === $basicDefinition->getMode();
    }
169038
function onlyDirectories ()
  {
    return $this->where (function ($f) {
      if (!is_object ($f) || !$f instanceof SplFileInfo)
        throw new \RuntimeException ("You must use FilesystemIterator::CURRENT_AS_PATHNAME with onlyDirectories() ");
      return $f->isDir ();
    });
  }
288294
public function isDirectory($dirname)
    {
        $listing = $this->listDirectoryContents();

        $dirname_info = array_filter($listing, function ($item) use ($dirname) {
            return $item['type'] === 'directory' && $item['name'] === $dirname;
        });

        return count($dirname_info) !== 0;
    }
927455
public function hasCycle()
	{
		if( $this->hasLoop() )
			return true;
		else
		{
			foreach( $this->getNodes() as $node )
				if( $this->isPath($node, $node ) )
					return true;
		}
		return false;
	}
1231868
public function isCurrentAncestor()
    {
        if (null === $this->isCurrentAnchestor)
        {
            $this->isCurrentAnchestor = false;

            foreach ($this->getChildren() as $child)
            {
                if ($child->isOnCurrentPath())
                {
                    $this->isCurrentAnchestor = true;

                    break;
                }
            }
        }

        return $this->isCurrentAnchestor;
    }
473710
private function hasReturnType(): bool
    {
        if ($this->hasReturnType === null) {
            $this->hasReturnType = FunctionHelper::hasReturnTypeHint($this->file->getBaseFile(), $this->stackPos);
        }

        return $this->hasReturnType;
    }