From d2be1f905ebc2791f36cc111133a7d5de1be5e7d Mon Sep 17 00:00:00 2001 From: Tim Bischoff Date: Fri, 10 Nov 2023 13:51:22 +0100 Subject: [PATCH] 3.x: use union types (#262) * Use union types * Only classname without FQCN * Fix union type to return a bool * Add missing use * Don't use itself --- docs/en/request-authorization-middleware.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/en/request-authorization-middleware.rst b/docs/en/request-authorization-middleware.rst index ce4977e0..756d3fe6 100644 --- a/docs/en/request-authorization-middleware.rst +++ b/docs/en/request-authorization-middleware.rst @@ -23,6 +23,7 @@ and add:: use Authorization\Policy\RequestPolicyInterface; use Cake\Http\ServerRequest; + use Authorization\Policy\ResultInterface class RequestPolicy implements RequestPolicyInterface { @@ -31,9 +32,9 @@ and add:: * * @param \Authorization\IdentityInterface|null $identity Identity * @param \Cake\Http\ServerRequest $request Server Request - * @return bool + * @return \Authorization\Policy\ResultInterface|bool */ - public function canAccess($identity, ServerRequest $request) + public function canAccess($identity, ServerRequest $request): bool|ResultInterface { if ($request->getParam('controller') === 'Articles' && $request->getParam('action') === 'index'