Skip to content

Commit f81a0b6

Browse files
committed
160 - Remove return 'Value'
1 parent 61a8bc8 commit f81a0b6

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

app/code/Magento/CustomerGraphQl/Model/Resolver/Customer/Account/RevokeCustomerToken.php

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
use Magento\Authorization\Model\UserContextInterface;
1111
use Magento\Framework\GraphQl\Config\Element\Field;
1212
use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException;
13-
use Magento\Framework\GraphQl\Query\Resolver\Value;
14-
use Magento\Framework\GraphQl\Query\Resolver\ValueFactory;
1513
use Magento\Framework\GraphQl\Query\ResolverInterface;
1614
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1715
use Magento\Integration\Api\CustomerTokenServiceInterface;
@@ -31,24 +29,16 @@ class RevokeCustomerToken implements ResolverInterface
3129
*/
3230
private $customerTokenService;
3331

34-
/**
35-
* @var ValueFactory
36-
*/
37-
private $valueFactory;
38-
3932
/**
4033
* @param UserContextInterface $userContext
4134
* @param CustomerTokenServiceInterface $customerTokenService
42-
* @param ValueFactory $valueFactory
4335
*/
4436
public function __construct(
4537
UserContextInterface $userContext,
46-
CustomerTokenServiceInterface $customerTokenService,
47-
ValueFactory $valueFactory
38+
CustomerTokenServiceInterface $customerTokenService
4839
) {
4940
$this->userContext = $userContext;
5041
$this->customerTokenService = $customerTokenService;
51-
$this->valueFactory = $valueFactory;
5242
}
5343

5444
/**
@@ -60,9 +50,8 @@ public function resolve(
6050
ResolveInfo $info,
6151
array $value = null,
6252
array $args = null
63-
): Value {
64-
65-
$customerId = (int) $this->userContext->getUserId();
53+
) {
54+
$customerId = (int)$this->userContext->getUserId();
6655

6756
if ($customerId === 0) {
6857
throw new GraphQlAuthorizationException(
@@ -73,10 +62,6 @@ public function resolve(
7362
);
7463
}
7564

76-
$result = function () use ($customerId) {
77-
return $this->customerTokenService->revokeCustomerAccessToken($customerId);
78-
};
79-
80-
return $this->valueFactory->create($result);
65+
return $this->customerTokenService->revokeCustomerAccessToken($customerId);
8166
}
8267
}

0 commit comments

Comments
 (0)