Adding @ctags to export
This commit is contained in:
@@ -54,6 +54,8 @@ class RouteCollection {
|
||||
|
||||
/*
|
||||
* Find route files with names under pathname
|
||||
*
|
||||
* @ctag\t RouteCollection->crawl()
|
||||
*/
|
||||
public function crawl($basepath = __DIR__, $filenames = Array('Routes.php', 'routes.php')) {
|
||||
$instance = self::getInstance();
|
||||
@@ -73,6 +75,7 @@ class RouteCollection {
|
||||
/**
|
||||
*
|
||||
* Load the files with the routes
|
||||
* @ctag\t RouteCollection->loadRoutes()
|
||||
*/
|
||||
function loadRoutes() {
|
||||
$instance = self::getInstance();
|
||||
@@ -172,6 +175,10 @@ class RouteCollection {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @ctag RouteCollection::group('base',function(){})
|
||||
*/
|
||||
static function group($base = '', $callback){
|
||||
$collection = self::getInstance();
|
||||
$collection->_groupList = [];
|
||||
@@ -187,6 +194,7 @@ class RouteCollection {
|
||||
|
||||
/**
|
||||
*
|
||||
* @ctag RouteCollection::get('/url',function(){})
|
||||
*/
|
||||
static function get($uri, $callback, $weight = 0) {
|
||||
return self::add('GET', $uri, $callback, $weight);
|
||||
@@ -194,6 +202,7 @@ class RouteCollection {
|
||||
|
||||
/**
|
||||
*
|
||||
* @ctag RouteCollection::cli('/url',function(){})
|
||||
*/
|
||||
static function cli($uri, $callback, $weight = 0) {
|
||||
return self::add('CLI', $uri, $callback, $weight);
|
||||
@@ -201,6 +210,7 @@ class RouteCollection {
|
||||
|
||||
/**
|
||||
*
|
||||
* @ctag RouteCollection::post('/url',function(){})
|
||||
*/
|
||||
static function post($uri, $callback, $weight = 0) {
|
||||
return self::add('POST', $uri, $callback, $weight);
|
||||
@@ -208,6 +218,7 @@ class RouteCollection {
|
||||
|
||||
/**
|
||||
*
|
||||
* @ctag RouteCollection::put('/url',function(){})
|
||||
*/
|
||||
static function put($uri, $callback, $weight = 0) {
|
||||
return self::add('PUT', $uri, $callback, $weight);
|
||||
@@ -215,6 +226,7 @@ class RouteCollection {
|
||||
|
||||
/**
|
||||
*
|
||||
* @ctag RouteCollection::patch('/url',function(){})
|
||||
*/
|
||||
static function patch($uri, $callback, $weight = 0) {
|
||||
return self::add('PATCH', $uri, $callback, $weight);
|
||||
@@ -222,17 +234,25 @@ class RouteCollection {
|
||||
|
||||
/**
|
||||
*
|
||||
* @ctag RouteCollection::delete('/url',Controller@Method)
|
||||
* @ctag RouteCollection::delete('/url',function(){})
|
||||
*/
|
||||
static function delete($uri, $callback, $weight = 0) {
|
||||
return self::add('DELETE', $uri, $callback, $weight);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @ctag RouteCollection::resource('/url',function(){})
|
||||
*/
|
||||
static function resource($uri) {
|
||||
throw new Exception('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @ctag RouteCollection::add('VERB','/url',function(){})
|
||||
* @ctag RouteCollection::add('VERB','/url',Controller@Method)
|
||||
*/
|
||||
static function add($verb, $uri, $callback, $weight = 0) {
|
||||
$route = new Route();
|
||||
@@ -269,6 +289,7 @@ class RouteCollection {
|
||||
|
||||
/**
|
||||
*
|
||||
* @ctag RouteCollection::addDefaultMiddleware('name',function(){})
|
||||
*/
|
||||
static function addDefaultMiddleware($name = '', $function) {
|
||||
self::getInstance()->_defaultMiddlewares[$name] = $function;
|
||||
@@ -276,6 +297,7 @@ class RouteCollection {
|
||||
|
||||
/**
|
||||
*
|
||||
* @ctag RouteCollection::addDefaultMiddleware('name',function(){})
|
||||
*/
|
||||
static function registerMiddleware($name = '', $function) {
|
||||
self::getInstance()->_middlewareSet[$name] = $function;
|
||||
@@ -283,6 +305,7 @@ class RouteCollection {
|
||||
|
||||
/**
|
||||
*
|
||||
* @ctag RouteCollection::onHttpError(function(){})
|
||||
*/
|
||||
static function onHttpError($function) {
|
||||
$instance = self::getInstance();
|
||||
@@ -291,6 +314,7 @@ class RouteCollection {
|
||||
|
||||
/**
|
||||
*
|
||||
* @ctag RouteCollection::httpError($class)
|
||||
*/
|
||||
private function httpError(\stdClass $info) {
|
||||
$info = (array) $info;
|
||||
|
||||
Reference in New Issue
Block a user