Skip to content

Commit fc59d66

Browse files
committed
Modified ResourceGuardInterface parameters
Signed-off-by: alexmerlin <[email protected]>
1 parent a2b442f commit fc59d66

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/App/src/Guard/ResourceGuardInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
use Core\App\Entity\EntityInterface;
88
use Doctrine\ORM\EntityManagerInterface;
9-
use League\OAuth2\Server\Entities\UserEntityInterface;
9+
use Psr\Http\Message\ServerRequestInterface;
1010

1111
interface ResourceGuardInterface
1212
{
1313
public function __invoke(
14+
ServerRequestInterface $request,
1415
EntityManagerInterface $entityManager,
15-
UserEntityInterface $currentUser,
1616
EntityInterface $entity
1717
): void;
1818
}

src/App/src/Middleware/ResourceProviderMiddleware.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Api\App\Attribute\Resource;
88
use Api\App\Exception\ConflictException;
99
use Api\App\Exception\NotFoundException;
10-
use Api\App\IdentityInterface;
1110
use Api\App\Service\HandlerService;
1211
use Core\App\Entity\EntityInterface;
1312
use Core\App\Message;
@@ -81,11 +80,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
8180
}
8281

8382
if ($resource->hasGuard()) {
84-
(new $resource->guard())(
85-
$this->entityManager,
86-
$request->getAttribute(IdentityInterface::class),
87-
$entity
88-
);
83+
(new $resource->guard())($request, $this->entityManager, $entity);
8984
}
9085

9186
if ($request->getAttribute($entity::class) !== null) {

0 commit comments

Comments
 (0)