Filters all references -- url() and "@import" -- through a callable.

@param string   $content  The CSS
@param callable $callback A PHP callable
@param integer  $limit
@param integer  $count

@return string The filtered CSS
761608
public static function filterReferences($content, $callback, $limit = -1, &$count = 0)
    {
        $content = static::filterUrls($content, $callback, $limit, $count);
        $content = static::filterImports($content, $callback, $limit, $count, false);
        $content = static::filterIEFilters($content, $callback, $limit, $count);

        return $content;
    }
294279
public static function filterUrls($content, $callback)
    {
        $pattern = static::REGEX_URLS;

        return static::filterCommentless($content, function ($part) use (& $callback, $pattern) {
            return preg_replace_callback($pattern, $callback, $part);
        });
    }
144796
function limit( $count, $offset = null ) {

        if ( $this->parent_ ) {

            throw new \LogicException( 'Cannot limit referenced result' );

        }

        $clone = clone $this;

        $clone->limitCount = $count;
        $clone->limitOffset = $offset;

        return $clone;

    }
522336
public function seeElementCount($selector, $count)
    {
        $this->assertCount($count, $this->crawler->filter($selector));

        return $this;
    }
416927
public function filter(callable $callback = null)
    {
        if ($callback === null) {
            return new static(\array_filter($this->all()));
        }

        return new static(\array_filter($this->all(), $callback));
    }
178117
public function filter(callable $callback = null): CollectionInterface
    {
        if (!$callback) {
            $callback = function ($item) {
                return (bool)$item;
            };
        }

        return $this->wrap(function (Iterator $data) use ($callback) {
            foreach ($data as $key => $item) {
                if ($callback($item, $key)) {
                    yield $key => $item;
                }
            }
        });
    }
720910
final public function limit($offsetOrCount, $count = null)
    {
        $this->getQuery()->limit($offsetOrCount, $count);
        $this->pagedQuery = true;

        return $this;
    }
532949
public function filter(callable $callback = null)
    {
        if (!is_null($callback)) {
            return new static(
                $this->wye,
                array_filter($this->items, $callback, ARRAY_FILTER_USE_BOTH)
            );
        }

        return new static($this->wye, array_filter($this->items));
    }
861791
protected function doFilter($value, Closure $callback)
    {
        return true === $this->multiByteEnabled ?
            mb_convert_case($value, $this->mode, $this->encoding) : $callback($value);
    }
765820
public function listJobResults($type, $count = null, array $options = [])
    {
        $urlQuery = null;

        /** @var AbstractHttpRequest $request */
        $request          = $this->getRequest();
        $request->options = $options;
        $request->path    = $this->client->fullDatabasePath . static::API_PATH . '/' . $type;
        $urlQueryStr      = '';

        if ($count) {
            $urlQuery    = ['count' => $count];
            $urlQueryStr = $request->buildUrlQuery($urlQuery);
        }

        $request->path .= $urlQueryStr;

        $request->method = static::METHOD_GET;

        return $this->getReturnObject($request);
    }
1101669
public function replaceCallback(callable $callback, $subject, $limit = -1, & $count = null)
	{
		$this->clean();
		return preg_replace_callback($this->pattern, $callback, $subject, $limit, $count);
	}
1106449
public function getSubscribersToImport(
        \Magento\Store\Model\Website $website,
        $limit = 1000,
        $isCustomerCheck = true
    ) {
        return $this->getCollection()
            ->getSubscribersToImport(
                $website,
                $limit,
                $isCustomerCheck
            );
    }
415254
public function limit($sql, $count, $offset = 0)
    {
       $this->_connect();
       return $this->_serverType->limit($sql, $count, $offset);
    }
1289792
protected function paginateCustom(callable $callback, $limit = Pagination::DEFAULT_LIMIT)
    {
        $this->response->clear();

        return (new Pagination)->paginateOver($callback)->take($limit);
    }
293733
public static function for($pattern, $replacement, $subject, $limit)
    {
        try {
            list($result, $count) = is_callable($replacement) ?
                static::doReplacementWithCallable($pattern, $replacement, $subject, $limit) :
                static::doReplacement($pattern, $replacement, $subject, $limit);
        } catch (Exception $exception) {
            throw RegexFailed::replace($pattern, $subject, $exception->getMessage());
        }

        if ($result === null) {
            throw RegexFailed::replace($pattern, $subject, static::lastPregError());
        }

        return new static($pattern, $replacement, $subject, $result, $count);
    }
1238081
public function filter($callback = null)
    {
        $test = array_filter($this->data, $callback);
        $clone = clone $this;
        return $clone->reset($test);
    }
564625
protected function getListLanguage($count = false)
    {
        $list = $this->language->getList();

        $allowed = $this->getAllowedFiltersLanguage();
        $this->filterList($list, $allowed, $this->query_filter);
        $this->sortList($list, $allowed, $this->query_filter, array('code' => 'asc'));

        if ($count) {
            return count($list);
        }

        $this->limitList($list, $this->data_limit);
        $this->prepareListLanguage($list);
        return $list;
    }