GrumPHP\Collection\FilesCollection::size PHP Method

size() public method

$collection->filterBySize('> 10K'); $collection->filterBySize('<= 1Ki'); $collection->filterBySize(4);
See also: NumberComparator
public size ( string $size ) : FilesCollection
$size string A size range string
return FilesCollection
    public function size($size)
    {
        $comparator = new Comparator\NumberComparator($size);
        $filter = new Iterator\SizeRangeFilterIterator($this->getIterator(), [$comparator]);
        return new FilesCollection(iterator_to_array($filter));
    }