public function isStackable($filename)
    {
        try {
            $file = $this->matcher->getFile($filename);
        } catch (FileNotFoundException $e) {
            return false;
        }

        if (!in_array($file->getExtension(), $this->acceptedFileTypes)) {
            return false;
        }

        return !$this->contains($file);
    }
public function isStackable($filename)
    {
        try {
            $file = $this->matcher->getFile($filename);
        } catch (FileNotFoundException $e) {
            return false;
        }

        if (!in_array($file->getExtension(), $this->acceptedFileTypes)) {
            return false;
        }

        return !$this->contains($file);
    }
public function isStackable ( $ filename ) { try { $ file = $ this -> matcher -> getFile ( $ filename ) ; } catch ( FileNotFoundException $ e ) { return false ; } if ( ! in_array ( $ file -> getExtension ( ) , $ this -> acceptedFileTypes ) ) { return false ; } return ! $ this -> contains ( $ file ) ; }
Check if a given file can be added to the stack.

Requirements:
- File's extension is accepted
- File can be matched to filesystem
- File is not currently on the stack

@param FileInterface|string $filename

@return bool
Check if a given file can be added to the stack .