map

@param string $pattern
@param callable $callback
508011
private function mapRoute(string $pattern, callable $callback)
    {
        $word = self::getPattern($pattern);

        $pattern = '/^' . str_replace('/', '\/', $word) . '$/';
        $this->routes[$pattern] = $callback;
    }
1066566
public function map($callback) : ArrayList
    {
        $values = $this->_map($callback);
        $this->setValues($values);
        return $this;
    }
588082
public function mapToDictionary(callable $callback)
    {
        $dictionary = $this->map($callback)->reduce(function ($groups, $pair) {
            $groups[key($pair)][] = reset($pair);

            return $groups;
        }, []);

        return new static($dictionary);
    }
525147
public function map($callback)
    {
        $values = $this->_map($callback);
        $this->setValues($values);
        return new Collection($values);
    }
879033
public function delete(string $pattern, callable $callback)
    {
        if ($this->requestMethod === "DELETE") {
            $this->mapRoute($pattern, $callback);
        }
    }
1024553
public static function map(array $arr, callable $callback): array
    {
        $arrResult = [];

        foreach ($arr as $index => $value) {
            $arrResult[] = $callback($value, $index);
        }

        return $arrResult;
    }
928863
private function invoke($pattern, callable $call)
    {
        $pattern = is_array($pattern) ? $pattern : [$pattern];
        foreach ($pattern as $val) {
            $this->setRoute('INVOKE', [$val, $call]);
        }
        return $this;
    }
1057092
public function map($methods, $match, $callback)
    {
        return $this->routeService->attach($methods, $match, $callback);
    }
82027
function(pattern, callback) {
    glob(pattern, opts, function(err, globbedFiles) {
      if (isArray(globbedFiles) && globbedFiles.length && !err) {
        callback(null, globbedFiles);
      }
      else {
        console.error('The glob pattern ' + JSON.stringify(pattern) + ' did not match any files!');
        callback(null, []);
      }
    });
  }
350998
public function get(string $pattern, $callback, array $requirements = [])
    {
        return $this->match($pattern, $callback, $requirements, [Request::METHOD_GET, Request::METHOD_HEAD]);
    }
914804
public function group(string $pattern, $callable) : RouteGroupInterface
    {
        $router = $this->getRouter();
        $group  = $router->pushGroup($pattern, $callable);
        if (method_exists($group, 'setCallbackResolver')) {
            $callbackResolver = $this->getCallbackResolver();
            if ($callbackResolver instanceof CallbackResolverInterface) {
                $group->setCallbackResolver($callbackResolver);
            }
        }

        $group($this);
        $router->popGroup();
        return $group;
    }
1362206
public function group($pattern, $callable, $immediateCallable=null)
	{
		$group = $this->pushGroup($pattern, $callable);
		if ($immediateCallable) call_user_func($immediateCallable, $this);
		$this->popGroup();
		return $group;
	}
1094266
public function map(\Closure $callback)
    {

        $this->_items = array_map($callback, $this->_items);

        return $this;
    }
86190
public function mapSpread(callable $callback)
    {
        return $this->map(function ($chunk, $key) use ($callback) {
            $chunk[] = $key;

            return $callback(...$chunk);
        });
    }
109426
public function group($pattern, $callable)
    {
        /** @var RouteGroup $group */
        $group = $this->container->get('router')->pushGroup($pattern, $callable);
        $group->setContainer($this->container);
        $group($this);
        $this->container->get('router')->popGroup();

        return $group;
    }
631205
final public function map(Callable $callback)
	{
		$arr = array_map(
			$callback,
			array_values($this->{self::MAGIC_PROPERTY}),
			array_keys($this->{self::MAGIC_PROPERTY})
		);
		return static::createFromArray($arr);
	}
932211
public function map($callback) {

      if (!is_callable($callback)) {
        throw new \InvalidArgumentException('Invalid callback function');
      }

      foreach ($this->getItems() as $index => $item) {
        call_user_func_array($callback, array($item, $index, $this));
      }

      $this->rewind();

      return $this;
    }