Skip to content

Commit

Permalink
Updating the Url Utility Class
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Aug 24, 2016
1 parent c718c2f commit 829cd66
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Utilities/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use Arcanedev\Localization\Contracts\UrlInterface;
use Illuminate\Http\Request;
use Illuminate\Routing\Route;
use Illuminate\Routing\Router;

/**
* Class Url
Expand All @@ -29,9 +28,6 @@ class Url implements UrlInterface
*/
public static function extractAttributes($url = false)
{
/** @var Router $router */
$router = app('router');

$parse = parse_url($url);
$path = isset($parse['path']) ? explode('/', $parse['path']) : [];
$url = [];
Expand All @@ -40,6 +36,9 @@ public static function extractAttributes($url = false)
if ( ! empty($segment)) $url[] = $segment;
}

/** @var \Illuminate\Routing\Router $router */
$router = app('router');

return self::extractAttributesFromRoutes($url, $router->getRoutes());
}

Expand Down Expand Up @@ -194,8 +193,6 @@ private static function extractAttributesFromSegment($url, $path, $i, $j, $segme
* Check parsed URL.
*
* @param array $parsed
*
* @return array
*/
private static function checkParsedUrl(array &$parsed)
{
Expand Down

0 comments on commit 829cd66

Please sign in to comment.