Skip to content

Commit

Permalink
style: php-cs-fixer
Browse files Browse the repository at this point in the history
nullable_type_declaration_for_default_null_value php_unit_data_provider_static
  • Loading branch information
twinh committed Feb 4, 2024
1 parent f8714b8 commit 1918092
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Middleware/CheckPagePermission.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
12 changes: 6 additions & 6 deletions src/Service/PermissionMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) : '');
}
Expand Down

0 comments on commit 1918092

Please sign in to comment.