Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
ControllerParser Class Reference

Scans a controller to detect routes defined by annotations or attributes. More...

+ Inheritance diagram for ControllerParser:

Public Member Functions

 __construct (AnnotationsEngineInterface $annotsEngine)
 
 parse ($controllerClass)
 
 asArray ()
 
 isRest ()
 
 setSilent (bool $silent)
 

Static Public Member Functions

static parseRouteArray (&$result, $controllerClass, $routeArray, \ReflectionMethod $method, $methodName, $prefix='', $httpMethods=NULL)
 
- Static Public Member Functions inherited from ControllerParserPathTrait
static parseMethodPath (\ReflectionFunctionAbstract $method, $path)
 
static cleanpath ($prefix, $path="", &$isRoot=false)
 
static addParamsPath ($path, \ReflectionFunctionAbstract $method, $requirements)
 
static scanParam (&$parameters, &$hasOptional, $matches, $index, $paramMatch, $find, &$path, $requirement)
 

Data Fields

const HTTP_METHODS =['head','get','post','patch','put','delete','options','connect']
 

Private Member Functions

 parseMethods ($methods, $controllerClass, $inherited, $automated)
 
 isRoutable (\ReflectionMethod $method)
 
 parseAnnot (&$annot, $method)
 
 generateRouteAnnotationFromMethod (\ReflectionMethod $method)
 

Static Private Member Functions

static generateRouteName (string $controllerName, string $action)
 
static createRouteMethod (&$result, $controllerClass, $path, $httpMethods, $method, $parameters, $name, $cache, $duration, $priority, $callback=null, $isRoot=false)
 

Private Attributes

string $controllerClass
 
 $mainRouteClass
 
array $routesMethods = [ ]
 
bool $rest = false
 
bool $silent =false
 
 $annotsEngine
 

Static Private Attributes

static array $excludeds = [ '__construct','isValid','initialize','finalize','onInvalidControl','loadView','forward','redirectToRoute' ]
 

Additional Inherited Members

- Static Protected Member Functions inherited from ControllerParserPathTrait
static getPathFromMethod (\ReflectionMethod $method)
 
static parseMainPath (string $path, string $controllerClass)
 
- Static Protected Attributes inherited from ControllerParserPathTrait
static $mainParams
 

Detailed Description

Scans a controller to detect routes defined by annotations or attributes.

Ubiquity\cache\parser$ControllerParser This class is part of Ubiquity

Author
jcheron myadd.nosp@m.ress.nosp@m.mail@.nosp@m.gmai.nosp@m.l.com
Version
1.1.1

Definition at line 21 of file ControllerParser.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( AnnotationsEngineInterface  $annotsEngine)

Definition at line 39 of file ControllerParser.php.

Member Function Documentation

◆ asArray()

asArray ( )

Definition at line 117 of file ControllerParser.php.

◆ createRouteMethod()

static createRouteMethod ( $result,
  $controllerClass,
  $path,
  $httpMethods,
  $method,
  $parameters,
  $name,
  $cache,
  $duration,
  $priority,
  $callback = null,
  $isRoot = false 
)
staticprivate

Definition at line 179 of file ControllerParser.php.

◆ generateRouteAnnotationFromMethod()

generateRouteAnnotationFromMethod ( \ReflectionMethod  $method)
private

Definition at line 108 of file ControllerParser.php.

◆ generateRouteName()

static generateRouteName ( string  $controllerName,
string  $action 
)
staticprivate

Definition at line 112 of file ControllerParser.php.

◆ isRest()

isRest ( )

Definition at line 196 of file ControllerParser.php.

◆ isRoutable()

isRoutable ( \ReflectionMethod  $method)
private

Definition at line 92 of file ControllerParser.php.

◆ parse()

parse (   $controllerClass)

Definition at line 43 of file ControllerParser.php.

◆ parseAnnot()

parseAnnot ( $annot,
  $method 
)
private

Definition at line 99 of file ControllerParser.php.

◆ parseMethods()

parseMethods (   $methods,
  $controllerClass,
  $inherited,
  $automated 
)
private

Definition at line 67 of file ControllerParser.php.

◆ parseRouteArray()

static parseRouteArray ( $result,
  $controllerClass,
  $routeArray,
\ReflectionMethod  $method,
  $methodName,
  $prefix = '',
  $httpMethods = NULL 
)
static

Definition at line 146 of file ControllerParser.php.

◆ setSilent()

setSilent ( bool  $silent)
Parameters
bool$silent

Definition at line 203 of file ControllerParser.php.

Field Documentation

◆ $annotsEngine

$annotsEngine
private

Definition at line 37 of file ControllerParser.php.

◆ $controllerClass

string $controllerClass
private

Definition at line 25 of file ControllerParser.php.

◆ $excludeds

array $excludeds = [ '__construct','isValid','initialize','finalize','onInvalidControl','loadView','forward','redirectToRoute' ]
staticprivate

Definition at line 30 of file ControllerParser.php.

◆ $mainRouteClass

$mainRouteClass
private

Definition at line 26 of file ControllerParser.php.

◆ $rest

bool $rest = false
private

Definition at line 28 of file ControllerParser.php.

◆ $routesMethods

array $routesMethods = [ ]
private

Definition at line 27 of file ControllerParser.php.

◆ $silent

bool $silent =false
private

Definition at line 29 of file ControllerParser.php.

◆ HTTP_METHODS

const HTTP_METHODS =['head','get','post','patch','put','delete','options','connect']

Definition at line 23 of file ControllerParser.php.


The documentation for this class was generated from the following file: