Skip to content

Commit

Permalink
Revert "Update UrlGenerator to fully extend Illuminates UrlGenerator."
Browse files Browse the repository at this point in the history
This reverts commit 68eac66.
  • Loading branch information
hskrasek committed Aug 30, 2016
1 parent 3bd1895 commit cac67ab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 70 deletions.
18 changes: 1 addition & 17 deletions src/Provider/RoutingServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,7 @@ protected function registerRouter()
protected function registerUrlGenerator()
{
$this->app->singleton('api.url', function ($app) {
$routes = $app['router']->getRoutes();

$app->instance('routes', $routes);

$url = new UrlGenerator(
$routes, $app->rebinding(
'request', $this->requestRebinder()
)
);

$url->setSessionResolver(function () {
return $this->app['session'];
});

$app->rebinding('routes', function ($app, $routes) {
$app['url']->setRoutes($routes);
});
$url = new UrlGenerator($app['request']);

$url->setRouteCollections($app['Dingo\Api\Routing\Router']->getRoutes());

Expand Down
10 changes: 5 additions & 5 deletions src/Routing/UrlGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Dingo\Api\Routing;

use Illuminate\Http\Request;
use Illuminate\Routing\RouteCollection as IlluminateRouteCollection;
use Illuminate\Routing\UrlGenerator as IlluminateUrlGenerator;

class UrlGenerator extends IlluminateUrlGenerator
Expand All @@ -18,12 +17,13 @@ class UrlGenerator extends IlluminateUrlGenerator
/**
* Create a new URL generator instance.
*
* @param \Illuminate\Routing\RouteCollection $routes
* @param \Dingo\Api\Http\Request|Request $request
* @param \Dingo\Api\Http\Request $request
*
* @return void
*/
public function __construct(IlluminateRouteCollection $routes, Request $request)
public function __construct(Request $request)
{
parent::__construct($routes, $request);
$this->setRequest($request);
}

/**
Expand Down
48 changes: 0 additions & 48 deletions tests/Routing/UrlGeneratorTest.php

This file was deleted.

0 comments on commit cac67ab

Please sign in to comment.