Skip to content

Commit

Permalink
Rename method to better reflect what it does.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed May 13, 2017
1 parent 4ce5591 commit 3d96541
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Routing/Middleware/RoutingMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __construct(BaseApplication $app = null)
protected function loadRoutes()
{
if ($this->app) {
$builder = Router::getRouteBuilder('/');
$builder = Router::createRouteBuilder('/');
$this->app->routes($builder);
// Prevent routes from being loaded again
Router::$initialized = true;
Expand Down
4 changes: 2 additions & 2 deletions src/Routing/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ public static function parseNamedParams(ServerRequest $request, array $options =
* @param array $options The options for the builder
* @return \Cake\Routing\RouteBuilder
*/
public static function getRouteBuilder($path, array $options = [])
public static function createRouteBuilder($path, array $options = [])
{
$defaults = [
'routeClass' => static::defaultRouteClass(),
Expand Down Expand Up @@ -980,7 +980,7 @@ public static function scope($path, $params = [], $callback = null)
$options = $params;
unset($params['routeClass'], $params['extensions']);
}
$builder = static::getRouteBuilder('/', $options);
$builder = static::createRouteBuilder('/', $options);
$builder->scope($path, $params, $callback);
}

Expand Down
6 changes: 3 additions & 3 deletions tests/TestCase/Routing/RouterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3358,13 +3358,13 @@ public function testGetRouteCollection()
*
* @return void
*/
public function testGetRouteBuilder()
public function testCreateRouteBuilder()
{
$builder = Router::getRouteBuilder('/api');
$builder = Router::createRouteBuilder('/api');
$this->assertInstanceOf(RouteBuilder::class, $builder);
$this->assertSame('/api', $builder->path());

$builder = Router::getRouteBuilder('/', [
$builder = Router::createRouteBuilder('/', [
'routeClass' => 'InflectedRoute',
'extensions' => ['json']
]);
Expand Down

0 comments on commit 3d96541

Please sign in to comment.