Skip to content

Commit

Permalink
Remove Route::anyMethod() (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
rustamwin committed Jun 15, 2021
1 parent 35e786e commit 42b4841
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 23 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -34,7 +34,7 @@
"roave/infection-static-analysis-plugin": "^1.5",
"spatie/phpunit-watcher": "^1.23",
"vimeo/psalm": "^4.2",
"yiisoft/router-fastroute": "3.0.x-dev@dev"
"yiisoft/router-fastroute": "^3.0@dev"
},
"autoload": {
"psr-4": {
Expand Down
11 changes: 0 additions & 11 deletions src/Route.php
Expand Up @@ -139,17 +139,6 @@ public static function options(string $pattern, ?MiddlewareDispatcher $dispatche
return self::methods([Method::OPTIONS], $pattern, $dispatcher);
}

/**
* @param string $pattern
* @param MiddlewareDispatcher|null $dispatcher
*
* @return self
*/
public static function anyMethod(string $pattern, ?MiddlewareDispatcher $dispatcher = null): self
{
return self::methods(Method::ALL, $pattern, $dispatcher);
}

/**
* @param array $methods
* @param string $pattern
Expand Down
7 changes: 0 additions & 7 deletions tests/RouteTest.php
Expand Up @@ -95,13 +95,6 @@ public function testOptionsMethod(): void
$this->assertSame([Method::OPTIONS], $route->getMethods());
}

public function testAnyMethod(): void
{
$route = Route::anyMethod('/');

$this->assertSame(Method::ANY, $route->getMethods());
}

public function testPattern(): void
{
$route = Route::get('/test')->pattern('/test2');
Expand Down
2 changes: 1 addition & 1 deletion tests/Support/Container.php
Expand Up @@ -6,7 +6,7 @@

use Psr\Container\ContainerInterface;

class Container implements ContainerInterface
final class Container implements ContainerInterface
{
private array $instances;

Expand Down
2 changes: 1 addition & 1 deletion tests/Support/NotFoundException.php
Expand Up @@ -6,6 +6,6 @@

use Psr\Container\NotFoundExceptionInterface;

class NotFoundException extends \RuntimeException implements NotFoundExceptionInterface
final class NotFoundException extends \RuntimeException implements NotFoundExceptionInterface
{
}
2 changes: 1 addition & 1 deletion tests/Support/TestController.php
Expand Up @@ -7,7 +7,7 @@
use Nyholm\Psr7\Response;
use Psr\Http\Message\ResponseInterface;

class TestController
final class TestController
{
public function index(): ResponseInterface
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Support/TestMiddleware.php
Expand Up @@ -10,7 +10,7 @@
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;

class TestMiddleware implements MiddlewareInterface
final class TestMiddleware implements MiddlewareInterface
{
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
Expand Down

0 comments on commit 42b4841

Please sign in to comment.