From 19180925abd7867765e1dc6fde0c140417dc853d Mon Sep 17 00:00:00 2001 From: twinh Date: Sun, 4 Feb 2024 11:04:47 +0800 Subject: [PATCH] style: php-cs-fixer nullable_type_declaration_for_default_null_value php_unit_data_provider_static --- src/Middleware/CheckPagePermission.php | 2 +- src/Service/PermissionMap.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Middleware/CheckPagePermission.php b/src/Middleware/CheckPagePermission.php index 04b7989..28b3169 100644 --- a/src/Middleware/CheckPagePermission.php +++ b/src/Middleware/CheckPagePermission.php @@ -8,7 +8,7 @@ class CheckPagePermission extends BaseMiddleware { - public function __invoke($next, BaseController $controller = null) + public function __invoke($next, ?BaseController $controller = null) { if (false === $controller->getOption('requireAuth')) { return $next(); diff --git a/src/Service/PermissionMap.php b/src/Service/PermissionMap.php index 0c85a81..34c29ff 100644 --- a/src/Service/PermissionMap.php +++ b/src/Service/PermissionMap.php @@ -107,32 +107,32 @@ protected function parse(string $permission): array return explode('/', $permission, 3); } - protected function buildGet(string $scope, string $resource, string $more = null): string + protected function buildGet(string $scope, string $resource, ?string $more = null): string { return $this->build('GET', $scope, $resource, $more); } - protected function buildPost(string $scope, string $resource, string $more = null): string + protected function buildPost(string $scope, string $resource, ?string $more = null): string { return $this->build('POST', $scope, $resource, $more); } - protected function buildPut(string $scope, string $resource, string $more = null): string + protected function buildPut(string $scope, string $resource, ?string $more = null): string { return $this->build('PUT', $scope, $resource, $more); } - protected function buildPatch(string $scope, string $resource, string $more = null): string + protected function buildPatch(string $scope, string $resource, ?string $more = null): string { return $this->build('PATCH', $scope, $resource, $more); } - protected function buildDelete(string $scope, string $resource, string $more = null): string + protected function buildDelete(string $scope, string $resource, ?string $more = null): string { return $this->build('DELETE', $scope, $resource, $more); } - protected function build(string $method, string $scope, string $resource, string $more = null): string + protected function build(string $method, string $scope, string $resource, ?string $more = null): string { return $method . ' api/' . ($scope ? ($scope . '/') : '') . $resource . ($more ? ('/' . $more) : ''); }