Submit
Path:
~
/
/
proc
/
self
/
root
/
opt
/
psa
/
admin
/
plib
/
modules
/
monitoring
/
vendor
/
mezzio
/
mezzio-fastroute
/
src
/
File Content:
FastRouteRouterFactory.php
<?php declare (strict_types=1); namespace PleskMonitoring\Mezzio\Router; use ArrayAccess; use PleskMonitoring\Psr\Container\ContainerInterface; use function assert; use function is_array; /** * Create and return an instance of FastRouteRouter. * * Configuration should look like the following: * * <code> * 'router' => [ * 'fastroute' => [ * 'cache_enabled' => true, // true|false * 'cache_file' => '(/absolute/)path/to/cache/file', // optional * ], * ] * </code> * * @psalm-import-type FastRouteConfig from FastRouteRouter */ class FastRouteRouterFactory { public function __invoke(ContainerInterface $container) : FastRouteRouter { $config = $container->has('config') ? $container->get('config') : []; assert(is_array($config) || $config instanceof ArrayAccess); $routerConfig = $config['router'] ?? []; assert(is_array($routerConfig) || $routerConfig instanceof ArrayAccess); $options = $routerConfig['fastroute'] ?? []; assert(is_array($options)); /** @psalm-var FastRouteConfig $options */ return new FastRouteRouter(null, null, $options); } }
Edit
Rename
Chmod
Delete
FILE
FOLDER
INFO
Name
Size
Permission
Action
Exception
---
0755
FastRouteRouter
---
0755
FastRouteRouter.php
17753 bytes
0644
FastRouteRouterFactory.php
1168 bytes
0644
N4ST4R_ID | Naxtarrr