Skip to content

Commit

Permalink
3.x: use union types (#262)
Browse files Browse the repository at this point in the history
* Use union types

* Only classname without FQCN

* Fix union type to return a bool

* Add missing use

* Don't use itself
  • Loading branch information
Indianer3c authored Nov 10, 2023
1 parent 1dbd98a commit d2be1f9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/en/request-authorization-middleware.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ and add::

use Authorization\Policy\RequestPolicyInterface;
use Cake\Http\ServerRequest;
use Authorization\Policy\ResultInterface

class RequestPolicy implements RequestPolicyInterface
{
Expand All @@ -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'
Expand Down

0 comments on commit d2be1f9

Please sign in to comment.