<?php
/**
 * Filters out only queries generated by a function.
 *
 * @package tad\WPBrowser\Iterators\Filters
 */

namespace tad\WPBrowser\Iterators\Filters;

/**
 * Class FunctionQueriesFilter
 *
 * @package tad\WPBrowser\Iterators\Filters
 */
class FunctionQueriesFilter extends QueriesCallerBasedKeepingFilterIterator
{
    /**
     * ClassMethodQueriesFilter constructor.
     *
     * @param \Iterator<string> $iterator The iterator to filter.
     * @param string            $function The function to filter queries by.
     */
    public function __construct(\Iterator $iterator, $function)
    {
        parent::__construct($iterator);

        $this->needles = [
            $function
        ];
    }
}
