HttpMethodRoutesTrait uses trait:short
Table of Contents
Properties
- $delete : string|null
- $flags : int
- Bitmask representing enabled routes
- $get : string|null
- $list : string|null
- $patch : string|null
- $post : string|null
- $put : string|null
Methods
- count() : void
- Generates a special GET count route reference.
- delete() : void
- Generates a new DELETE route reference.
- describeFlags() : string
- Get a human-readable description of enabled routes
- disableFlags() : static
- Disable specific route flags
- enableFlags() : static
- Enable specific route flags
- get() : void
- Generates a new GET route reference.
- hasCount() : bool
- Check if COUNT route is enabled
- hasDelete() : bool
- Check if DELETE route is enabled
- hasDeleteMultiple() : bool
- Check if DELETE_MULTIPLE is enabled
- hasGet() : bool
- Check if GET route is enabled
- hasList() : bool
- Check if LIST route is enabled
- hasPatch() : bool
- Check if PATCH route is enabled
- hasPost() : bool
- Check if POST route is enabled
- hasPut() : bool
- Check if PUT route is enabled
- initializeFlags() : static
- Initialize the internal flags.
- initializeMethods() : static
- Initializes or overrides HTTP method handlers based on the given init array.
- list() : void
- Generates a new GET (LIST) route reference.
- method() : void
- options() : void
- Generates a new OPTIONS route reference.
- patch() : void
- Generates a new PATCH route reference.
- post() : void
- Generates a new POST route reference.
- put() : void
- Generates a new PUT route reference.
Properties
$delete
public
string|null
$delete
= null
$flags
Bitmask representing enabled routes
public
int
$flags
= \oihana\routes\enums\RouteFlag::DEFAULT
$get
public
string|null
$get
= null
$list
public
string|null
$list
= null
$patch
public
string|null
$patch
= null
$post
public
string|null
$post
= null
$put
public
string|null
$put
= null
Methods
count()
Generates a special GET count route reference.
public
count(array<string|int, mixed> &$routes, string $route[, string|null $method = HttpMethod::count ]) : void
Parameters
- $routes : array<string|int, mixed>
- $route : string
- $method : string|null = HttpMethod::count
delete()
Generates a new DELETE route reference.
public
delete(array<string|int, mixed> &$routes, string $route[, string|null $method = null ]) : void
Parameters
- $routes : array<string|int, mixed>
- $route : string
- $method : string|null = null
describeFlags()
Get a human-readable description of enabled routes
public
describeFlags() : string
Return values
string —Description of enabled routes
disableFlags()
Disable specific route flags
public
disableFlags(int $flags) : static
Parameters
- $flags : int
-
Flags to disable
Return values
staticenableFlags()
Enable specific route flags
public
enableFlags(int $flags) : static
Parameters
- $flags : int
-
Flags to enable
Return values
staticget()
Generates a new GET route reference.
public
get(array<string|int, mixed> &$routes, string $route[, string|null $method = null ]) : void
Parameters
- $routes : array<string|int, mixed>
- $route : string
- $method : string|null = null
hasCount()
Check if COUNT route is enabled
public
hasCount() : bool
Return values
boolhasDelete()
Check if DELETE route is enabled
public
hasDelete() : bool
Return values
boolhasDeleteMultiple()
Check if DELETE_MULTIPLE is enabled
public
hasDeleteMultiple() : bool
Return values
boolhasGet()
Check if GET route is enabled
public
hasGet() : bool
Return values
boolhasList()
Check if LIST route is enabled
public
hasList() : bool
Return values
boolhasPatch()
Check if PATCH route is enabled
public
hasPatch() : bool
Return values
boolhasPost()
Check if POST route is enabled
public
hasPost() : bool
Return values
boolhasPut()
Check if PUT route is enabled
public
hasPut() : bool
Return values
boolinitializeFlags()
Initialize the internal flags.
public
initializeFlags([array<string|int, mixed>|int $init = [] ]) : static
Parameters
- $init : array<string|int, mixed>|int = []
Return values
staticinitializeMethods()
Initializes or overrides HTTP method handlers based on the given init array.
public
initializeMethods([array<string|int, mixed> $init = [] ]) : static
Parameters
- $init : array<string|int, mixed> = []
-
Initialization or override parameters.
Return values
staticlist()
Generates a new GET (LIST) route reference.
public
list(array<string|int, mixed> &$routes, string $route[, string|null $method = HttpMethod::list ]) : void
Parameters
- $routes : array<string|int, mixed>
- $route : string
- $method : string|null = HttpMethod::list
method()
public
method(string $clazz, array<string|int, mixed> &$routes, string $route[, string|null $method = null ]) : void
Parameters
- $clazz : string
- $routes : array<string|int, mixed>
- $route : string
- $method : string|null = null
Tags
options()
Generates a new OPTIONS route reference.
public
options(array<string|int, mixed> &$routes, string $route[, bool $flag = true ]) : void
Parameters
- $routes : array<string|int, mixed>
- $route : string
- $flag : bool = true
Tags
patch()
Generates a new PATCH route reference.
public
patch(array<string|int, mixed> &$routes, string $route[, string|null $method = null ]) : void
Parameters
- $routes : array<string|int, mixed>
- $route : string
- $method : string|null = null
post()
Generates a new POST route reference.
public
post(array<string|int, mixed> &$routes, string $route[, string|null $method = null ]) : void
Parameters
- $routes : array<string|int, mixed>
- $route : string
- $method : string|null = null
put()
Generates a new PUT route reference.
public
put(array<string|int, mixed> &$routes, string $route[, string|null $method = null ]) : void
Parameters
- $routes : array<string|int, mixed>
- $route : string
- $method : string|null = null