Add middleware lib.
This commit is contained in:
parent
f38c6610fb
commit
eb27acf68e
27
src/Libs/Middleware.php
Normal file
27
src/Libs/Middleware.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Middleware - DuckBrain
|
||||
*
|
||||
* Librería base para middlewares.
|
||||
*
|
||||
* @author KJ
|
||||
* @website https://kj2.me
|
||||
* @licence MIT
|
||||
*/
|
||||
|
||||
namespace Libs;
|
||||
|
||||
class Middleware {
|
||||
|
||||
/**
|
||||
* Llama al siguiente callback.
|
||||
*
|
||||
* @param Neuron $req
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function next(Neuron $req) {
|
||||
$next = array_pop($req->next);
|
||||
return call_user_func_array($next, [$req]);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user