owncloud / files_external_dropbox

📦 App for Integration of Dropbox
GNU General Public License v2.0
13 stars 5 forks source link

Does not accept League\Flysystem\Filesystem in Storage/dropbox::setFlysystem #86

Open jasson99 opened 4 years ago

jasson99 commented 4 years ago

When working on updating phpstan for files_external_dropbox, this error is found:

------ ----------------------------------------------------------------------------------------------------------------------------------------------------------- 
  Line   lib/Storage/Dropbox.php                                                                                                                                    
 ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------- 
  79     Property OCA\Files_external_dropbox\Storage\Dropbox::$flysystem (OCA\Files_external_dropbox\Storage\Adapter) does not accept League\Flysystem\Filesystem.  
 ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------- 

The function including line 79 is:

/**
     * Initialize the storage backend with a flyssytem adapter
     * @override
     * @param \League\Flysystem\Filesystem $fs
     */
    public function setFlysystem($fs) {
        $this->flysystem = $fs;
        $this->flysystem->addPlugin(new \League\Flysystem\Plugin\GetWithMetadata());
    }

And line 79 is:

        $this->flysystem = $fs;
phil-davis commented 4 years ago

Maybe this is a real problem, or maybe it is safe to just override this in phpstan? Someone who knows the code needs to look at it.