Skip to content

Commit

Permalink
Update Collection.php
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronlord authored Feb 19, 2021
1 parent afce2a4 commit d71fab4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Routes/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@
namespace Lord\Laroute\Routes;

use Illuminate\Routing\Route;
use Illuminate\Routing\RouteCollection;
use Illuminate\Routing\RouteCollectionInterface;
use Illuminate\Support\Arr;
use Lord\Laroute\Routes\Exceptions\ZeroRoutesException;

class Collection extends \Illuminate\Support\Collection
{
public function __construct(RouteCollection $routes, $filter, $namespace)
public function __construct(RouteCollectionInterface $routes, $filter, $namespace)
{
$this->items = $this->parseRoutes($routes, $filter, $namespace);
}

/**
* Parse the routes into a jsonable output.
*
* @param RouteCollection $routes
* @param RouteCollectionInterface $routes
* @param string $filter
* @param string $namespace
*
* @return array
* @throws ZeroRoutesException
*/
protected function parseRoutes(RouteCollection $routes, $filter, $namespace)
protected function parseRoutes(RouteCollectionInterface $routes, $filter, $namespace)
{
$this->guardAgainstZeroRoutes($routes);

Expand All @@ -40,11 +40,11 @@ protected function parseRoutes(RouteCollection $routes, $filter, $namespace)
/**
* Throw an exception if there aren't any routes to process
*
* @param RouteCollection $routes
* @param RouteCollectionInterface $routes
*
* @throws ZeroRoutesException
*/
protected function guardAgainstZeroRoutes(RouteCollection $routes)
protected function guardAgainstZeroRoutes(RouteCollectionInterface $routes)
{
if (count($routes) < 1) {
throw new ZeroRoutesException("You don't have any routes!");
Expand Down

0 comments on commit d71fab4

Please sign in to comment.