Documentation

RoutesSet

Trait RouterSet

Tags
author

Dodonov A.A.

version

v.1.0 (2019/08/15)

copyright

Copyright (c) 2019, http://aeon.su

Table of Contents

$bunchSize  : int
Bunch size
$regExpsWereCompiled  : bool
Were regexps compiled?
dumpOnDisk()  : void
Method dumps all routes and their names on disk
loadFromDisk()  : void
Method loads routes from disk
addParamRoute()  : void
Method adds param router
clearOtherData()  : void
Method clears other data
getAllRoutesTrace()  : string
Method rturns all available routes
paramRouteExists()  : bool
Method returns true if the param router exists
compileRegexpForBunch()  : void
Method compiles regexp for the bunch of routes
compileRegexpForBunches()  : void
Method compiles all regeps for all routes
getRegExpAppendix()  : string
Generating appendix for the RegExp

Properties

$bunchSize

Bunch size

private int $bunchSize = 100

$regExpsWereCompiled

Were regexps compiled?

private bool $regExpsWereCompiled = false

Methods

dumpOnDisk()

Method dumps all routes and their names on disk

public dumpOnDisk([string $filePath = './cache/cache.php' ]) : void
Parameters
$filePath : string = './cache/cache.php'

file path to cache

Tags
codeCoverageIgnore
Return values
void

loadFromDisk()

Method loads routes from disk

public loadFromDisk([string $filePath = './cache/cache.php' ]) : void
Parameters
$filePath : string = './cache/cache.php'

file path to cache

Tags
codeCoverageIgnore
psalm-suppress

UnresolvableInclude, MixedArrayAccess, MixedAssignment

Return values
void

addParamRoute()

Method adds param router

protected addParamRoute(string $requestMethod, string $route, mixed $callback) : void
Parameters
$requestMethod : string

request method

$route : string

route

$callback : mixed
Tags
psalm-suppress

PossiblyUndefinedArrayOffset

Return values
void

clearOtherData()

Method clears other data

protected clearOtherData() : void
Return values
void

getAllRoutesTrace()

Method rturns all available routes

protected getAllRoutesTrace() : string
Tags
psalm-suppress

PossiblyUndefinedArrayOffset

Return values
string

trace

paramRouteExists()

Method returns true if the param router exists

protected paramRouteExists(string $route, string $requestMethod) : bool
Parameters
$route : string

checking route

$requestMethod : string

HTTP request method

Return values
bool

true if the param router exists, false otherwise

compileRegexpForBunch()

Method compiles regexp for the bunch of routes

private compileRegexpForBunch(array<string|int, mixed> &$bunch) : void
Parameters
$bunch : array<string|int, mixed>
Return values
void

compileRegexpForBunches()

Method compiles all regeps for all routes

private compileRegexpForBunches() : void
Return values
void

getRegExpAppendix()

Generating appendix for the RegExp

private getRegExpAppendix(int $i) : string
Parameters
$i : int

count of ()

Return values
string

appendix

Search results