@param callable $callable

@return ReflectionFunctionAbstract
199431
private function createReflection(callable $callable)
    {
        if (is_string($callable) && strpos($callable, '::')) {
            $callable = explode('::', $callable);
        }

        if (is_array($callable)) {
            return new ReflectionMethod($callable[0], $callable[1]);
        }

        if (is_object($callable) && method_exists($callable, '__invoke')) {
            return new ReflectionMethod($callable, '__invoke');
        }

        return new ReflectionFunction($callable);
    }
254943
public function filter(callable $callable)
    {
        $results = [];

        foreach ($this->items as $key => $item) {
            if ($callable($item, $key)) {
                $results[] = $item;
            }
        }

        return new self($results);
    }
111967
public function map($callable)
    {
        if (!$this->isCallable($callable)) {
            throw new ArrayObjectException(ArrayObjectException::MSG_INVALID_PARAM, [
                '$callable',
                'a callable function or method'
            ]);
        }

        $this->val(array_map($callable, $this->val()));

        return $this;
    }
1232404
public function traverseFilters(callable $callable)
    {
        foreach ($this->filters() as $expr) {
            /**
             * @param  FilterInterface           $expr The iterated filter expression object.
             * @param  FilterCollectionInterface $this The context of the traversal.
             * @return void
             */
            $callable($expr, $this);
            if ($expr instanceof FilterCollectionInterface) {
                $expr->traverseFilters($callable);
            }
        }

        return $this;
    }
827158
public function invoke(Callable $callable, array $args = [])
    {
        // object/class method
        if (is_string($callable) && false !== strpos($callable, '::')) {
            $callable = explode('::', $callable);
        }
        if (is_array($callable)) {
            $reflection = new \ReflectionMethod($callable[0], $callable[1]);
        }

        // closures, functions and any other callable
        if (!isset($reflection)) {
            $reflection = new \ReflectionFunction($callable);
        }

        // inject arguments
        $arguments = $this->inject($reflection, $args);
        return $callable(...$arguments);
    }
742777
public function map( $callable ) {
		$elements = array();
		$type = null;
		foreach ( $this->elements as $element ) {
			$result = call_user_func( $callable, $element );

			if ( null === $type ) {
				$type = gettype( $result );

				if ( 'object' === $type ) {
					$type = get_class( $result );
				}
			}

			$elements[] = $result;
		}

		return $this->new_from_trusted( $elements, $type ? : $this->get_type() );
	}
525625
public function register(callable $callable)
    {
        $this->groups[$this->group] = $this->options;

        $callable($this);

        array_pop($this->groups);

        return $this;
    }
891145
public function map(callable $callable)
    {
        $keys = array_keys($this->items);
        $results = array_map($callable, $this->items, $keys);

        return new self($results);
    }
489335
public function dynamic($callable)
    {
        return $this->attributes[$this->attribute] = new self::$classMap['dynamic']($this->attribute, $this->entity, $callable);
    }
944371
public function map(callable $callable)
    {
        $keys = $this->keys();
        $items = array_map($callable, $this->attributes, $keys);

        return new static(array_combine($keys, $items));
    }
204157
public function options($callable = null)
    {
        if (null === $callable) {
            if (is_callable($this->options)) {
                return call_user_func($this->options);
            }

            $rep = new $this->options;

            return $rep->options();
        }

        $this->options = $callable;

        return $this;
    }
146740
public function resolveFunctionParameters($callable, $parameters, $labels = false)
    {
        // method reflection
        $reflectionFunction = new ReflectionFunction($callable);

        // resolved array of parameters
        return $this->resolveParameters($reflectionFunction->getParameters(), $parameters, $labels);
    }
719709
public function extend($name, callable $callable)
    {
        if ($this->parent) {
            $this->parent->extend($name, $callable);
        }

        if ($callable instanceof Closure) {
            $callable = $callable->bindTo($this);
        }

        $this->callables[$name] = $callable;

        return $this;
    }
985369
public function compiled(callable $callable): string
    {
        if (! $this->compiler) {
            $this->compiler = new Compiler(
                new AstAnalyzerAdapter(
                    new AstAnalyzer
                )
            );
        }

        return ($this->compiler)($callable);
    }
359771
public static function getReflection(callable $f)
    {
        if (is_string($f)) {
            if (strpos($f, '::', 1) !== false) {
                return new \ReflectionMethod($f);
            } else {
                return new \ReflectionFunction($f);
            }
        } elseif (is_array($f) && count($f) == 2) {
            return new \ReflectionMethod($f[0], $f[1]);
        } elseif ($f instanceof \Closure) {
            return new \ReflectionFunction($f);
        } elseif (is_object($f) && method_exists($f, '__invoke')) {
            return new \ReflectionMethod($f, '__invoke');
        }
        // if the tests above are exhaustive, we should never hit the next line.
        throw new AnnotationException("Unable to determine callable type.");
    }
79198
public function map( $callable ) {
		$items = array();
		$val_type = null;

		foreach ( $this->storage as $key => $val ) {
			$v = call_user_func( $callable, $val, $key );

			if ( ! isset( $val_type ) ) {
				$val_type = gettype( $v );
			}

			$items[ $key ] = $v;
		}

		return new static( $this->get_key_type(), $val_type ? : $this->get_value_type(), $items );
	}
581238
public function extend(string $offset, callable $callable): callable
    {
        isset($this->keys[$offset])
            || Exception::unknownProperty($offset);
        isset($this->frozen[$offset])
            && Exception::overrideService($offset);
        is_object($this->items[$offset])
            || Exception::unknownMethod('__invoke');
        method_exists($this->items[$offset], '__invoke')
            || Exception::unknownMethod('__invoke');
        isset($this->protect[$this->items[$offset]])
            && Exception::permission($offset);
        is_object($callable)
            || Exception::unknownMethod('__invoke');
        method_exists($callable, '__invoke')
            || Exception::unknownMethod('__invoke');

        $factory = $this->items[$offset];
        $extended = function ($c) use ($callable, $factory) {
            return $callable($factory($c), $c);
        };
        if (isset($this->factory[$factory])) {
            $this->factory->detach($factory);
            $this->factory->attach($extended);
        }
        return $this[$offset] = $extended;
    }