Get a Closure that represents a slice of the application onion.

@return \Closure
429964
protected function carry()
    {
        return function ($stack, $pipe) {
            return function ($passable) use ($stack, $pipe) {
                try {
                    $slice = parent::carry();

                    return \call_user_func($slice($stack, $pipe), $passable);
                } catch (Exception $e) {
                    return $this->handleException($passable, $e);
                } catch (Throwable $e) {
                    return $this->handleException($passable, new FatalThrowableError($e));
                }
            };
        };
    }
834575
public function getEdgesOut()
    {
        $that = $this;

        return $this->getEdges()->getEdgesMatch(function (Edge $edge) use ($that) {
            return $edge->hasVertexStart($that);
        });
    }
475448
private function getRepository()
    {
        $c = $this->repository;
        if ($c instanceof \Closure) {
            $this->repository = $c();
        }

        return $this->repository;
    }
379925
public function getName()
    {
        $name = $this->reflection->getName();

        if (strpos($name, '{closure}') !== false)
        {
            return null;
        }

        return $name;
    }
91800
public function getReflection()
	{
		if($this->reflection === NULL)
		{
			if(is_array($this->callback))
			{
				$this->reflection = (new \ReflectionClass($this->callback[0]))->getMethod($this->callback[1]);
			}
			elseif(is_object($this->callback) && !$this->callback instanceof \Closure)
			{
				$this->reflection = (new \ReflectionClass($this->callback))->getMethod('__invoke');
			}
			else
			{
				$this->reflection = new \ReflectionFunction($this->callback);
			}
		}
		
		return $this->reflection;
	}
500733
private function getClosure($name) {
        return isset($this->bindings[$name]) ? $this->bindings[$name]['closure'] : $name;
    }
215149
public function getActionAsClosure()
    {
        if ($this->action instanceof \Closure)
        {
            return $this->action;
        }

        return function () {

            $action = $this->getActionAsCallable();

            return call_user_func_array($action, func_get_args());
        };
    }
212252
protected function getAuthorsColumn(): Closure
    {
        return function(ExtensionContract $extension) {
            $authors = array_map(function(array $author) {
                if (array_key_exists('email', $author)) {
                    return (string) HTML::mailto($author['email'], $author['name']);
                }

                return $author['name'];
            }, $extension->getPackage()->getAuthors());

            $prefix = '';

            if ($extension->getVendorName() === 'antaresproject') {
                $prefix = trans('antares/foundation::title.antares_team');
            }

            return $prefix . ' - ' . implode(', ', $authors);
        };
    }
1291093
public function getCacheManager()
    {
        if ($this->cache instanceof Closure) {
            $this->cache = call_user_func($this->cache);
        }

        return $this->cache;
    }
394308
function getCurrent(): \Closure {
    return function($value, \Mustache_LambdaHelper $helper) {
      $args = $this->parseArguments($helper->render($value), 'params', ['scheme' => false]);
      return UrlHelper::current($args['params'], $args['scheme']);
    };
  }
1284449
public static function rowMapper(): Closure
    {
        return static function (stdClass $row): Source {
            return Source::getInstance($row->s_id, Tree::findById((int) $row->s_file), $row->s_gedcom);
        };
    }
603452
public function closure(Closure $closure, array $params = [])
    {
        $reflection = new \ReflectionFunction($closure);
        $resolved = $this->resolve($reflection->getParameters(), $params);
        return call_user_func_array($closure, $resolved);
    }
772308
private function createStageCallback() : Closure
    {
        return function ($stages, $stage) {
            return function ($input) use ($stages, $stage) {
                if ($stage instanceof Closure) {
                    return $stage($input, $stages);
                } else {
                    if ($this->methodToCall === null) {
                        throw new PipelineException('Method must not be null');
                    }

                    if (!method_exists($stage, $this->methodToCall)) {
                        throw new PipelineException(get_class($stage) . "::{$this->methodToCall} does not exist");
                    }

                    return $stage->{$this->methodToCall}($input, $stages);
                }
            };
        };
    }
528478
public function getCallGraph()
    {
        $node = $root = new Node(array());
        foreach ($this->getQueries() as $query) {
            foreach (array_reverse($query['trace']) as $trace) {
                $node = $node->push($trace);
            }
            $node->addValue($query);
            $node = $root;
        }

        return $root;
    }
301918
public function cliRegister() : Closure
  {
    return function($exception, $inspector, $run) {
      Output::error($exception);
      die($exception . PHP_EOL);
      exit;
    };
  }
889105
protected function getSlice()
	{
		return function ( $stack, $pipe )
		{
			return function ( $passable ) use ( $stack, $pipe )
			{
				try
				{
					$slice = $this->getSliceWithException();

					return call_user_func( $slice( $stack, $pipe ), $passable );
				}
				catch ( \Exception $e )
				{
					if ( is_callable( $this->exceptionHandler ) )
						return call_user_func( $this->exceptionHandler, $passable, $e );
					else
						throw new PipelineException( $e->getMessage(), 0, $e );
				}
				catch ( \Throwable $e )
				{
					if ( is_callable( $this->exceptionHandler ) )
						return call_user_func( $this->exceptionHandler, $passable, new FatalThrowableError( $e ) );
					else
						throw new PipelineException( $e->getMessage(), 0, $e );
				}
			};
		};
	}
101058
private function phpErrorHandler(): Closure
    {
        return static function (int $errno, string $errstr, string $errfile, int $errline): bool {
            // Ignore errors that are silenced with '@'
            if (error_reporting() & $errno) {
                throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
            }

            return true;
        };
    }