__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* Slim Framework (https://slimframework.com)
*
* @license https://github.com/slimphp/Slim/blob/4.x/LICENSE.md (MIT License)
*/
declare(strict_types=1);
namespace Slim\Routing;
use Psr\Http\Server\MiddlewareInterface;
use Slim\Interfaces\AdvancedCallableResolverInterface;
use Slim\Interfaces\CallableResolverInterface;
use Slim\Interfaces\RouteCollectorProxyInterface;
use Slim\Interfaces\RouteGroupInterface;
use Slim\MiddlewareDispatcher;
class RouteGroup implements RouteGroupInterface
{
/**
* @var callable|string
*/
protected $callable;
protected CallableResolverInterface $callableResolver;
protected RouteCollectorProxyInterface $routeCollectorProxy;
/**
* @var MiddlewareInterface[]|string[]|callable[]
*/
protected array $middleware = [];
protected string $pattern;
/**
* @param callable|string $callable
*/
public function __construct(
string $pattern,
$callable,
CallableResolverInterface $callableResolver,
RouteCollectorProxyInterface $routeCollectorProxy
) {
$this->pattern = $pattern;
$this->callable = $callable;
$this->callableResolver = $callableResolver;
$this->routeCollectorProxy = $routeCollectorProxy;
}
/**
* {@inheritdoc}
*/
public function collectRoutes(): RouteGroupInterface
{
if ($this->callableResolver instanceof AdvancedCallableResolverInterface) {
$callable = $this->callableResolver->resolveRoute($this->callable);
} else {
$callable = $this->callableResolver->resolve($this->callable);
}
$callable($this->routeCollectorProxy);
return $this;
}
/**
* {@inheritdoc}
*/
public function add($middleware): RouteGroupInterface
{
$this->middleware[] = $middleware;
return $this;
}
/**
* {@inheritdoc}
*/
public function addMiddleware(MiddlewareInterface $middleware): RouteGroupInterface
{
$this->middleware[] = $middleware;
return $this;
}
/**
* {@inheritdoc}
*/
public function appendMiddlewareToDispatcher(MiddlewareDispatcher $dispatcher): RouteGroupInterface
{
foreach ($this->middleware as $middleware) {
$dispatcher->add($middleware);
}
return $this;
}
/**
* {@inheritdoc}
*/
public function getPattern(): string
{
return $this->pattern;
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Dispatcher.php | File | 2.41 KB | 0777 |
|
| FastRouteDispatcher.php | File | 3.1 KB | 0777 |
|
| Route.php | File | 8.82 KB | 0777 |
|
| RouteCollector.php | File | 7.47 KB | 0777 |
|
| RouteCollectorProxy.php | File | 4.52 KB | 0777 |
|
| RouteContext.php | File | 2.36 KB | 0777 |
|
| RouteGroup.php | File | 2.47 KB | 0777 |
|
| RouteParser.php | File | 3.81 KB | 0777 |
|
| RouteResolver.php | File | 1.48 KB | 0777 |
|
| RouteRunner.php | File | 2.34 KB | 0777 |
|
| RoutingResults.php | File | 2.32 KB | 0777 |
|