Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Router fix #19

Merged
merged 2 commits into from
Jan 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Middleware/Callback.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Yiisoft\Router\Middleware;

use Psr\Http\Message\ResponseInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
$middleware = current($this->middlewares);
next($this->middlewares);
if ($middleware === false) {
if (!$this->nextHandler !== null) {
if ($this->nextHandler !== null) {
return $this->nextHandler->handle($request);
}

Expand Down
1 change: 0 additions & 1 deletion src/RouteCollectorInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Yiisoft\Router;

interface RouteCollectorInterface
Expand Down
1 change: 0 additions & 1 deletion tests/GroupTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Yiisoft\Router\Tests;

use PHPUnit\Framework\TestCase;
Expand Down
4 changes: 2 additions & 2 deletions tests/MatchingResultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testProcessFailure(): void

private function getMiddleware(): MiddlewareInterface
{
return new class() implements MiddlewareInterface {
return new class implements MiddlewareInterface {
public function process(
ServerRequestInterface $request,
RequestHandlerInterface $handler
Expand All @@ -75,7 +75,7 @@ public function process(

private function getRequestHandler(): RequestHandlerInterface
{
return new class() implements RequestHandlerInterface {
return new class implements RequestHandlerInterface {
public function handle(ServerRequestInterface $request): ResponseInterface
{
return new Response(404);
Expand Down
6 changes: 3 additions & 3 deletions tests/Middleware/RouterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private function getMatcher(): UrlMatcherInterface
{
$middleware = $this->createRouteMiddleware();

return new class($middleware) implements UrlMatcherInterface {
return new class ($middleware) implements UrlMatcherInterface {
private $middleware;

public function __construct(MiddlewareInterface $middleware)
Expand Down Expand Up @@ -85,7 +85,7 @@ public function match(ServerRequestInterface $request): MatchingResult

private function createRequestHandler(): RequestHandlerInterface
{
return new class() implements RequestHandlerInterface {
return new class implements RequestHandlerInterface {
public function handle(ServerRequestInterface $request): ResponseInterface
{
return new Response(404);
Expand All @@ -95,7 +95,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface

private function createRouteMiddleware(): MiddlewareInterface
{
return new class() implements MiddlewareInterface {
return new class implements MiddlewareInterface {
public function process(
ServerRequestInterface $request,
RequestHandlerInterface $handler
Expand Down
4 changes: 2 additions & 2 deletions tests/RouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function testToMiddleware(): void
$request = new ServerRequest('GET', '/');

$route = Route::get('/')->to(
new class() implements MiddlewareInterface {
new class implements MiddlewareInterface {
public function process(
ServerRequestInterface $request,
RequestHandlerInterface $handler
Expand Down Expand Up @@ -213,7 +213,7 @@ public function testBefore(): void

private function getRequestHandler(): RequestHandlerInterface
{
return new class() implements RequestHandlerInterface {
return new class implements RequestHandlerInterface {
public function handle(ServerRequestInterface $request): ResponseInterface
{
return new Response(404);
Expand Down