Skip to content
Permalink
Browse files

Better method signatures for Routing.

  • Loading branch information...
dereuromark authored and ADmad committed Sep 5, 2014
1 parent 40acf40 commit 203de9f8e4b076f5c85101010c490f618a391817
Showing with 5 additions and 5 deletions.
  1. +2 −2 src/Routing/RouteBuilder.php
  2. +1 −1 src/Routing/RouteCollection.php
  3. +2 −2 src/Routing/Router.php
@@ -219,7 +219,7 @@ public function params() {
* - 'actions' - Override the method names used for connecting actions.
*
* @param string $name A controller name to connect resource routes for.
* @param array $options Options to use when generating REST routes
* @param array|callable $options Options to use when generating REST routes
* @param callable $callback An optional callback to be executed in a nested scope. Nested
* scopes inherit the existing path and 'id' parameter.
* @return array Array of mapped resources
@@ -440,7 +440,7 @@ protected function _makeRoute($route, $defaults, $options) {
* shifted into the passed arguments. As well as supplying patterns for routing parameters.
* @return array Array of routes
*/
public function redirect($route, $url, $options = []) {
public function redirect($route, $url, array $options = []) {
$options['routeClass'] = 'Cake\Routing\Route\RedirectRoute';
if (is_string($url)) {
$url = array('redirect' => $url);
@@ -74,7 +74,7 @@ class RouteCollection {
* `_name` option, which enables named routes.
* @return void
*/
public function add(Route $route, $options = []) {
public function add(Route $route, array $options = []) {
$this->_routes[] = $route;
// Explicit names
@@ -756,7 +756,7 @@ public static function extensions($extensions = null, array $options = []) {
* @param array $options The array of options.
* @return \Cake\Network\Request The modified request
*/
public static function parseNamedParams(Request $request, $options = []) {
public static function parseNamedParams(Request $request, array $options = []) {
$options += array('separator' => ':');
if (empty($request->params['pass'])) {
$request->params['named'] = [];
@@ -829,7 +829,7 @@ public static function parseNamedParams(Request $request, $options = []) {
* @return null|\Cake\Routing\RouteBuilder The route builder
* was created/used.
*/
public static function scope($path, $params = [], $callback = null) {
public static function scope($path, array $params = [], $callback = null) {
$builder = new RouteBuilder(static::$_collection, '/', [], [
'routeClass' => static::defaultRouteClass(),
'extensions' => static::$_collection->extensions()

0 comments on commit 203de9f

Please sign in to comment.
You can’t perform that action at this time.