mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-09 19:45:13 +02:00
refactor(dynamic): enhance framework bindings with SSA receiver type checks, add tests for Laravel, Symfony, Rabbit, Kafka, and Pub/Sub
This commit is contained in:
parent
aaa1fd7ede
commit
17fa611b63
17 changed files with 1255 additions and 167 deletions
|
|
@ -3,8 +3,33 @@
|
|||
// `$routes->get('run', 'UserController::run')` references the
|
||||
// controller method whose body shells out without sanitisation.
|
||||
|
||||
namespace CodeIgniter\Router {
|
||||
class RouteCollection
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
use CodeIgniter\Router\RouteCollection;
|
||||
|
||||
class BaseController
|
||||
{
|
||||
}
|
||||
|
||||
class NyxRoutes extends RouteCollection
|
||||
{
|
||||
public function get(string $path, string $callable)
|
||||
{
|
||||
$GLOBALS['__nyx_route'] = function (string $payload) use ($callable) {
|
||||
[$class, $method] = explode('::', $callable, 2);
|
||||
$controller = new $class();
|
||||
return $controller->$method($payload);
|
||||
};
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
$routes = new NyxRoutes();
|
||||
$routes->get('run', 'UserController::run');
|
||||
|
||||
class UserController extends BaseController
|
||||
|
|
@ -18,3 +43,4 @@ class UserController extends BaseController
|
|||
return $out;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue