@@ -26,17 +26,11 @@ class ORouter extends AbstractRouter
2626 /** @var int */
2727 private $ routeCounter = 0 ;
2828
29- /**
30- * some available patterns regex
31- * $router->get('/user/{num}', 'handler');
32- * @var array
33- */
34- private static $ globalParams = [
35- 'any ' => '[^/]+ ' , // match any except '/'
36- 'num ' => '[0-9]+ ' , // match a number
37- 'id ' => '[1-9][0-9]* ' , // match a ID number
38- 'act ' => '[a-zA-Z][\w-]+ ' , // match a action name
39- 'all ' => '.* '
29+ /** @var array global Options */
30+ private $ globalOptions = [
31+ // 'domains' => [ 'localhost' ], // allowed domains
32+ // 'schemas' => [ 'http' ], // allowed schemas
33+ // 'time' => ['12'],
4034 ];
4135
4236 /** @var string */
@@ -277,7 +271,7 @@ public function group($prefix, \Closure $callback, array $opts = [])
277271 * 'params' => [ 'id' => '[0-9]+', ],
278272 * 'defaults' => [ 'id' => 10, ],
279273 * 'domains' => [ 'a-domain.com', '*.b-domain.com'],
280- * 'schemes ' => ['https'],
274+ * 'schemas ' => ['https'],
281275 * ]
282276 * @return static
283277 * @throws \LogicException
@@ -487,26 +481,6 @@ public function dispatch($dispatcher = null, $path = null, $method = null)
487481 * helper methods
488482 ******************************************************************************/
489483
490- /**
491- * @param array $params
492- */
493- public function addGlobalParams (array $ params )
494- {
495- foreach ($ params as $ name => $ pattern ) {
496- $ this ->addGlobalParam ($ name , $ pattern );
497- }
498- }
499-
500- /**
501- * @param $name
502- * @param $pattern
503- */
504- public function addGlobalParam ($ name , $ pattern )
505- {
506- $ name = trim ($ name , '{} ' );
507- self ::$ globalParams [$ name ] = $ pattern ;
508- }
509-
510484 /**
511485 * @return int
512486 */
@@ -571,22 +545,6 @@ public function getRouteCaches()
571545 return $ this ->routeCaches ;
572546 }
573547
574- /**
575- * @return array
576- */
577- public function getGlobalParams ()
578- {
579- return self ::$ globalParams ;
580- }
581-
582- /**
583- * @return array
584- */
585- public static function getSupportedMethods ()
586- {
587- return self ::SUPPORTED_METHODS ;
588- }
589-
590548 /**
591549 * @param null|string $name
592550 * @param null|mixed $default
0 commit comments