private function createFileDirIfNotExists(string $filename): bool
    {
        $pathinfo = pathinfo($filename);
        if (isset($pathinfo['dirname']) && $pathinfo['dirname'] !== '.') {
            if (is_dir($pathinfo['dirname'])) {
                return true;
            } elseif (is_file($pathinfo['dirname'])) {
                return false;
            } else {
                return $this->createDirIfNotExists($pathinfo['dirname']);
            }
        }
        return false;
    }
private function createFileDirIfNotExists(string $filename): bool
    {
        $pathinfo = pathinfo($filename);
        if (isset($pathinfo['dirname']) && $pathinfo['dirname'] !== '.') {
            if (is_dir($pathinfo['dirname'])) {
                return true;
            } elseif (is_file($pathinfo['dirname'])) {
                return false;
            } else {
                return $this->createDirIfNotExists($pathinfo['dirname']);
            }
        }
        return false;
    }
private function createFileDirIfNotExists ( string $ filename ) : bool { $ pathinfo = pathinfo ( $ filename ) ; if ( isset ( $ pathinfo [ 'dirname' ] ) && $ pathinfo [ 'dirname' ] !== '.' ) { if ( is_dir ( $ pathinfo [ 'dirname' ] ) ) { return true ; } elseif ( is_file ( $ pathinfo [ 'dirname' ] ) ) { return false ; } else { return $ this -> createDirIfNotExists ( $ pathinfo [ 'dirname' ] ) ; } } return false ; }
Creates the directory of the file specified.

@param string $filename The filename.
@return boolean TRUE if successful, FALSE otherwise.
@throws \IvoPetkov\ObjectStorage\ErrorException
Creates the directory of the file specified .