PHP Class Webiny\Component\Rest\Parser\MethodParser

Inheritance: use trait Webiny\Component\Annotations\AnnotationsTrait
Mostrar archivo Open project: Webiny/Framework Class Usage Examples

Public Methods

Method Description
__construct ( array $classes, ReflectionMethod $method, boolean $normalize ) Base constructor.
parse ( ) : ParsedMethod Parse the method and return an instance of ParsedMethod.

Private Methods

Method Description
buildUrlPatternFromPattern ( string $pattern, array $parameters ) : string Builds the url pattern using the rest.url definition from method phpDoc.
buildUrlPatternStandard ( string $methodName, array $parameters ) : string Builds the url match pattern for each of the method inside the api.
getCache ( ConfigObject $annotations ) : array Extracts parameters regarding the cache form method annotations.
getDefault ( ConfigObject $annotations ) : boolean Checks if the method is flagged as "default".
getHeader ( ConfigObject $annotations ) : array Extracts http header information from method annotations.
getMethod ( ConfigObject $annotations ) : string Returns the name of the http method for accessing the api.
getRateControl ( ConfigObject $annotations ) : array Extracts the rate control information from the method annotations.
getRole ( ConfigObject $annotations ) : string | boolean If method has defined a access rule, this will return the name of the required role for accessing the method.

Method Details

__construct() public method

Base constructor.
public __construct ( array $classes, ReflectionMethod $method, boolean $normalize )
$classes array API class tree.
$method ReflectionMethod Method that should be parsed.
$normalize boolean Should the class name and the method name be normalized.

parse() public method

Parse the method and return an instance of ParsedMethod.
public parse ( ) : ParsedMethod
return ParsedMethod