Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Finder.php

function Finder::size

Adds tests for file sizes.

$finder->size('> 10K'); $finder->size('<= 1Ki'); $finder->size(4); $finder->size(['> 10K', '< 20K'])

Parameters

string|int|string[]|int[] $sizes A size range string or an integer or an array of size ranges:

Return value

$this

See also

SizeRangeFilterIterator

NumberComparator

File

vendor/symfony/finder/Finder.php, line 307

Class

Finder
Finder allows to build rules to find files and directories.

Namespace

Symfony\Component\Finder

Code

public function size(string|int|array $sizes) : static {
    foreach ((array) $sizes as $size) {
        $this->sizes[] = new NumberComparator($size);
    }
    return $this;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal