Skip to content

Commit

Permalink
Support for view routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Radiergummi committed Feb 7, 2021
1 parent 0d77546 commit 3704526
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/RouteCollecting/ResolvedRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Matchory\Herodot\RouteCollecting;

use Illuminate\Routing\Route;
use Illuminate\Routing\ViewController;
use Illuminate\Support\Facades\File;
use Matchory\Herodot\Interfaces\ResolvedRouteInterface;
use ReflectionClass;
Expand All @@ -28,6 +29,11 @@ public function __construct(
) {
}

public function isView(): bool
{
return $this->route->getController() === ViewController::class;
}

/**
* @inheritDoc
*/
Expand Down
4 changes: 0 additions & 4 deletions src/RouteCollecting/RouteCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ protected function hasValidAction(Route $route): bool
/** @var class-string $controller */
$controller = $route->getController();

if (is_a($controller, ViewController::class)) {
return false;
}

if (is_a($controller, RedirectController::class)) {
return false;
}
Expand Down
1 change: 1 addition & 0 deletions src/RouteCollecting/RouteResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Closure;
use Illuminate\Routing\Route;
use Illuminate\Routing\ViewController;
use JetBrains\PhpStorm\ArrayShape;
use Matchory\Herodot\Contracts\RouteResolver as Contract;
use Matchory\Herodot\Interfaces\ResolvedRouteInterface;
Expand Down

0 comments on commit 3704526

Please sign in to comment.