From b058ffc1264338ac4e1fce5504f34198d3827955 Mon Sep 17 00:00:00 2001 From: Angger Pradana Date: Wed, 8 Nov 2023 18:55:08 +0700 Subject: [PATCH] chore, formatting: bump dependency (#241) - update php-cs-fixer 3.38 - formatting: function_declaration, binary_operator_spaces --- composer.json | 2 +- src/System/Integrate/Http/Karnel.php | 2 +- src/System/Router/Router.php | 2 +- tests/Router/RouteDispatchTest.php | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index ab036d04..eab4e0d8 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "require-dev": { "phpunit/phpunit": "^9.6", "mockery/mockery": "^1.6", - "friendsofphp/php-cs-fixer": "^3.27", + "friendsofphp/php-cs-fixer": "^3.38", "phpstan/phpstan": "^1.10", "rector/rector": "^0.17" }, diff --git a/src/System/Integrate/Http/Karnel.php b/src/System/Integrate/Http/Karnel.php index f5549382..829678b8 100644 --- a/src/System/Integrate/Http/Karnel.php +++ b/src/System/Integrate/Http/Karnel.php @@ -45,7 +45,7 @@ public function handle(Request $request) $pipeline = array_reduce( array_merge($this->middleware, $dispatcher['middleware']), fn ($next, $middleware) => fn ($req) => $this->app->call([$middleware, 'handle'], ['request' => $req, 'next' => $next]), - fn () => $this->responesType($dispatcher['callable'], $dispatcher['parameters']) + fn () => $this->responesType($dispatcher['callable'], $dispatcher['parameters']) ); return $pipeline($request); diff --git a/src/System/Router/Router.php b/src/System/Router/Router.php index 1c89f35f..5409582e 100644 --- a/src/System/Router/Router.php +++ b/src/System/Router/Router.php @@ -447,7 +447,7 @@ public static function run($basepath = '', $case_matters = false, $trailing_slas ->multimatch($multimatch) ->run( fn ($current, $params) => call_user_func_array($current, $params), - fn ($path) => call_user_func_array(self::$pathNotFound, [$path]), + fn ($path) => call_user_func_array(self::$pathNotFound, [$path]), fn ($path, $method) => call_user_func_array(self::$methodNotAllowed, [$path, $method]) ); diff --git a/tests/Router/RouteDispatchTest.php b/tests/Router/RouteDispatchTest.php index acc19810..394f96f7 100644 --- a/tests/Router/RouteDispatchTest.php +++ b/tests/Router/RouteDispatchTest.php @@ -32,7 +32,7 @@ public function itCanResultCurrentRoute() $dispatch = $dispatcher->run( fn ($callable, $params) => call_user_func_array($callable, $params), - fn ($path) => 'not found - ', + fn ($path) => 'not found - ', fn ($path, $method) => 'method not allowd - - ', ); @@ -48,7 +48,7 @@ public function itCanDispatchAndCall() $dispatch = $dispatcher->run( fn ($callable, $params) => call_user_func_array($callable, $params), - fn ($path) => 'not found - ', + fn ($path) => 'not found - ', fn ($path, $method) => 'method not allowd - - ', ); @@ -64,7 +64,7 @@ public function itCanDispatchAndRunFound() $dispatch = $dispatcher->run( fn () => 'found', - fn ($path) => 'not found - ', + fn ($path) => 'not found - ', fn ($path, $method) => 'method not allowd - - ', ); @@ -80,7 +80,7 @@ public function itCanDispatchAndRunNotFound() $dispatch = $dispatcher->run( fn () => 'found', - fn ($path) => 'not found - ', + fn ($path) => 'not found - ', fn ($path, $method) => 'method not allowd - - ', ); @@ -96,7 +96,7 @@ public function itCanDispatchAndRunMethodNotAllowed() $dispatch = $dispatcher->run( fn () => 'found', - fn ($path) => 'not found - ', + fn ($path) => 'not found - ', fn ($path, $method) => 'method not allowd - - ', );