App
The app class
Table of Contents
- $pipeline : Pipeline
- The pipeline of workers
- $postprocessing : array<string|int, mixed>
- Contains the worker defined by user whose must be run just after the Launcher and before the Response
- $preprocessing : array<string|int, mixed>
- Contains the workers defined by user whose must be run just after the RequestHandler and before the Router
- $routes : array<string|int, mixed>
- Routes defined by user
- __construct() : mixed
- addDeleteRoute() : void
- Add delete route
- addGetRoute() : void
- Add get route
- addPostProcess() : void
- Add a post process
- addPostRoute() : void
- Add post route
- addPreProcess() : void
- Add a preprocess
- addPutRoute() : void
- Add put route
- delete() : void
- Handle delete request
- get() : void
- Handle get request
- post() : void
- Handle post request
- put() : void
- Handle put request
- removePostProcess() : void
- Remove a post process
- removePreProcess() : void
- Remove a preprocess
- run() : void
- Run the app
- addRoute() : void
- Put a route into app routes
- getFunction() : array<string|int, mixed>
- Get a function format from a given argument
Properties
$pipeline
The pipeline of workers
private
Pipeline
$pipeline
$postprocessing
Contains the worker defined by user whose must be run just after the Launcher and before the Response
private
array<string|int, mixed>
$postprocessing
$preprocessing
Contains the workers defined by user whose must be run just after the RequestHandler and before the Router
private
array<string|int, mixed>
$preprocessing
$routes
Routes defined by user
private
array<string|int, mixed>
$routes
Methods
__construct()
public
__construct() : mixed
Return values
mixed —addDeleteRoute()
Add delete route
public
addDeleteRoute(string $path, string $class, mixed $function) : void
Parameters
- $path : string
- $class : string
- $function : mixed
Return values
void —addGetRoute()
Add get route
public
addGetRoute(string $path, string $class, mixed $function) : void
Parameters
- $path : string
- $class : string
- $function : mixed
Return values
void —addPostProcess()
Add a post process
public
addPostProcess(string $name, Worker $worker) : void
Parameters
- $name : string
- $worker : Worker
Return values
void —addPostRoute()
Add post route
public
addPostRoute(string $path, string $class, mixed $function) : void
Parameters
- $path : string
- $class : string
- $function : mixed
Return values
void —addPreProcess()
Add a preprocess
public
addPreProcess(string $name, Worker $worker) : void
Parameters
- $name : string
- $worker : Worker
Return values
void —addPutRoute()
Add put route
public
addPutRoute(string $path, string $class, mixed $function) : void
Parameters
- $path : string
- $class : string
- $function : mixed
Return values
void —delete()
Handle delete request
public
delete(string $path, mixed $function) : void
Parameters
- $path : string
- $function : mixed
Return values
void —get()
Handle get request
public
get(string $path, mixed $function) : void
Parameters
- $path : string
- $function : mixed
Return values
void —post()
Handle post request
public
post(string $path, mixed $function) : void
Parameters
- $path : string
- $function : mixed
Return values
void —put()
Handle put request
public
put(string $path, mixed $function) : void
Parameters
- $path : string
- $function : mixed
Return values
void —removePostProcess()
Remove a post process
public
removePostProcess(string $name, Worker $worker) : void
Parameters
- $name : string
- $worker : Worker
Return values
void —removePreProcess()
Remove a preprocess
public
removePreProcess(string $name, Worker $worker) : void
Parameters
- $name : string
- $worker : Worker
Return values
void —run()
Run the app
public
run() : void
Return values
void —addRoute()
Put a route into app routes
private
addRoute(string $method, string $path, string $class, mixed $function) : void
Parameters
- $method : string
- $path : string
- $class : string
- $function : mixed
Return values
void —getFunction()
Get a function format from a given argument
private
getFunction(mixed $function) : array<string|int, mixed>
Parameters
- $function : mixed