public function delete($filename)
    {
        $this->initialize();

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

        foreach ($this->files as $key => $item) {
            if ($item->getFullPath() === $file->getFullPath()) {
                unset($this->files[$key]);
                $this->files = array_values($this->files); // normalize indexes
                $this->persist();
                break;
            }
        }
    }
public function delete($filename)
    {
        $this->initialize();

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

        foreach ($this->files as $key => $item) {
            if ($item->getFullPath() === $file->getFullPath()) {
                unset($this->files[$key]);
                $this->files = array_values($this->files); // normalize indexes
                $this->persist();
                break;
            }
        }
    }
public function delete ( $ filename ) { $ this -> initialize ( ) ; try { $ file = $ this -> matcher -> getFile ( $ filename ) ; } catch ( FileNotFoundException $ e ) { return ; } foreach ( $ this -> files as $ key => $ item ) { if ( $ item -> getFullPath ( ) === $ file -> getFullPath ( ) ) { unset ( $ this -> files [ $ key ] ) ; $ this -> files = array_values ( $ this -> files ) ; // normalize indexes $ this -> persist ( ) ; break ; } } }
Delete a file from the stack.

@param FileInterface|string $filename
Delete a file from the stack .