src/Server/GridFSServer.php
protected function gridFS(BucketInterface $bucket): Bucket
    {
        if (empty($this->database)) {
            $this->database = new Database(
                new Manager($this->options['connection']),
                $this->options['database']
            );
        }

        return $this->database->selectGridFSBucket([
            'bucketName' => $bucket->getOption('bucket')
        ]);
    }
protected function gridFS(BucketInterface $bucket): Bucket
    {
        if (empty($this->database)) {
            $this->database = new Database(
                new Manager($this->options['connection']),
                $this->options['database']
            );
        }

        return $this->database->selectGridFSBucket([
            'bucketName' => $bucket->getOption('bucket')
        ]);
    }
protected function gridFS ( BucketInterface $ bucket ) : Bucket { if ( empty ( $ this -> database ) ) { $ this -> database = new Database ( new Manager ( $ this -> options [ 'connection' ] ) , $ this -> options [ 'database' ] ) ; } return $ this -> database -> selectGridFSBucket ( [ 'bucketName' => $ bucket -> getOption ( 'bucket' ) ] ) ; }
Get valid GridFS collection associated with bucket.

@param BucketInterface $bucket Bucket instance.

@return Bucket
Get valid GridFS collection associated with bucket .