@param int    $Iterator
@param string $field
@param string $pattern
@param int    $count

@return bool | array
430662
public function hscan(&$Iterator, $field, $pattern = null, $count = null)
    {
        return $this->__call('hscan', [$field, &$Iterator, $pattern, $count]);
    }
425685
public function stream_read($count) {
    assert(isset($this->client));
    return $this->client->read($count);
  }
804496
public function getFileCount( $pattern = NULL )
	{
		$count	= 0;
		foreach( $this->getFileList( $pattern ) as $entry )
			$count++;
		return $count;
	}
362270
private static function pop(\ArrayIterator $iterator): string
    {
        $current = $iterator->current();
        $iterator->next();

        return $current;
    }
1188546
public function pregReplace($pattern, $replace, $limit = -1, &$count = null)
    {
        $this->string = preg_replace($pattern, $replace, $this->string, $limit, $count);

        return $this;
    }
314418
public function fields($pattern, $position = 0)
    {
        /**
         * Redis returns collection's cursor first and then
         * an array of elements found.
         */
        return $this->getClient()->hscan(
            $this->getKey()->getName()
            , $position
            , 'MATCH'
            , $pattern
        );
    }
414542
public function zScan($key, $cursor, $pattern = null, $count = null) {
        return $this->_scan('zscan', $key, $cursor, $pattern, $count);
    }
661020
public function hscan($str_key, &$i_iterator, $str_pattern = null, $i_count = null)
    {
        return $this->xxxScan('hscan', $str_key, $i_iterator, $str_pattern, $i_count);
    }
993002
public static function sortBy($collection = null, $iterator = null, $sort_flag = null)
    {
        $results = array();
        foreach ($collection as $k => $item) {
            if (is_callable($iterator)) {
                $results[$k] = $iterator($item);
            }
            if (is_object($item)) {
                $results[$k] = $item->$iterator;
            } elseif (is_array($item)) {
                $results[$k] = $item[$iterator];
            }
        }
        $sort_flag = (is_null($sort_flag)) ? SORT_REGULAR : $sort_flag;
        asort($results, $sort_flag);
        foreach ($results as $k => $v) {
            $results[$k] = $collection[$k];
        }
        return $results;
    }
1078222
public function sScan($key, $cursor, $pattern = null, $count = null) {
        return $this->_scan('sscan', $key, $cursor, $pattern, $count);
    }
107529
public static function transpilePattern($pattern, $host = false, array $requirements = [], array $defaults = [])
    {
        $tokens = self::tokenizePattern($pattern, $host, $requirements, $defaults);

        $staticPath = !$tokens[0] instanceof Variable ? $tokens[0]->value : '/';

        $regex = self::transpileMatchRegex($tokens);

        return self::getCompact($staticPath, $regex, $tokens);
    }
347420
public function iterNextPage($count = 3)
    {
        if ($this->getPage() == 1 && $this->getPagesCount() >= $count * 2) {
            $count *= 2;
        }
        $pages = [];
        foreach (range(1, $count) as $i) {
            $page = $this->getPage() + $i;
            if ($page <= $this->getPagesCount()) {
                $pages[] = $page;
            }
        }

        return $pages;
    }
684918
protected function iterate(IterableResult $iterator, callable $callback = null)
    {
        $iteration = 0;
        foreach ($iterator as $object) {
            /** @var Redirect $object */
            $object = current($object);
            yield $object;
            if ($callback !== null) {
                call_user_func($callback, $iteration, $object);
            }
            $iteration++;
        }
    }
867584
public function groupBy(array $collection, Closure $iterator)
    {
        $groups = [];

        foreach ($collection as $node)
        {
            $groups[$iterator($node)][] = $node;
        }

        sort($groups);

        return $groups;
    }
812194
public function getFolderCount( $pattern = NULL )
	{
		$count	= 0;
		foreach( $this->getFolderList( $pattern ) as $entry )
			$count++;
		return $count;
	}
1373832
private function inspectParsedMethods( $countCalls = FALSE )
	{
		foreach( $this->methods as $method => $data )												//  iterate before parsed methods
		{
			foreach( $data['lines'] as $nr => $line )												//  iterate method/function lines
			{
				$pattern	= "@^ *\t*[$]([a-z0-9_]+)(\t| )+=[^>].*@i";								//  prepare regular expression for variable assignment
				if( preg_match( $pattern, $line ) )													//  line contains variable assignment
					if( $var = trim( preg_replace( $pattern, "\\1", $line ) ) )						//  extract variable name from line
						if( !array_key_exists( $var, $this->methods[$method]['variables'] ) )		//  variable is not noted, yet
							$this->methods[$method]['variables'][$var]	= 0;						//  note newly found variable
				foreach( $this->methods[$method]['variables'] as $name => $count )					//  iterate known method/function variables
				{
					if( !$countCalls && $count )													//  variable is used and count mode is off
						continue;																	//  skip to next line
					if( preg_match( "/\(/", $name ) || preg_match( "/\)/", $name ) )
						xmp( $method."::".$name.' ('.join( ",", array_keys( $this->methods ) ).')' );
					$line		= preg_replace( "/\$".addslashes( $name )."\s*=/", "", $line );					//  remove variable assignment if found
					if( preg_match( '@\$'.addslashes( $name ).'[^a-z0-9_]@i', $line ) ){							//  if variable is used in this line
						$this->methods[$method]['variables'][$name]++;								//  increate variable's use counter
					}
				}
			}
		}
	}
646229
public function hasMutator($field) {
        $method = sprintf('set%sAttribute', Inflector::camelCase($field));

        if (method_exists($this, $method)) {
            return $method;
        }

        return null;
    }