public function count(): int
    {
        if ($this->count == null) {
            $this->count = 0;

            if ($handle = opendir($this->fileInfo->getAbsoluteFilePath())) {
                while (($file = readdir($handle)) !== false) {
                    if (!in_array($file, array('.', '..'))) {
                        $this->count++;
                    }
                }

                closedir($handle);
            }
        }

        return $this->count;
    }
public function count(): int
    {
        if ($this->count == null) {
            $this->count = 0;

            if ($handle = opendir($this->fileInfo->getAbsoluteFilePath())) {
                while (($file = readdir($handle)) !== false) {
                    if (!in_array($file, array('.', '..'))) {
                        $this->count++;
                    }
                }

                closedir($handle);
            }
        }

        return $this->count;
    }
public function count ( ) : int { if ( $ this -> count == null ) { $ this -> count = 0 ; if ( $ handle = opendir ( $ this -> fileInfo -> getAbsoluteFilePath ( ) ) ) { while ( ( $ file = readdir ( $ handle ) ) !== false ) { if ( ! in_array ( $ file , array ( '.' , '..' ) ) ) { $ this -> count ++ ; } } closedir ( $ handle ) ; } } return $ this -> count ; }
Returns the total number of directories and files in the directory.

@return int
Returns the total number of directories and files in the directory .