src/Collection/FilesCollection.php
public function notPaths(array $pattern): self
    {
        $filter = new Iterator\PathFilterIterator($this->getIterator(), [], $pattern);

        return new self(iterator_to_array($filter));
    }
public function notPaths(array $pattern): self
    {
        $filter = new Iterator\PathFilterIterator($this->getIterator(), [], $pattern);

        return new self(iterator_to_array($filter));
    }
public function notPaths ( array $ pattern ) : self { $ filter = new Iterator \ PathFilterIterator ( $ this -> getIterator ( ) , [ ] , $ pattern ) ; return new self ( iterator_to_array ( $ filter ) ) ; }
Adds rules that filenames must not match.

You can use patterns (delimited with / sign) or simple strings.

$collection->notPaths(['/^spec\/','/^src\/'])
Adds rules that filenames must not match .