File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed
app/code/Magento/Quote/Model Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change 3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
-
7
6
declare (strict_types=1 );
8
7
9
8
namespace Magento \Quote \Model ;
12
11
use Magento \Quote \Api \ChangeQuoteControlInterface ;
13
12
use Magento \Quote \Api \Data \CartInterface ;
14
13
15
- /**
16
- * {@inheritdoc}
17
- */
18
14
class ChangeQuoteControl implements ChangeQuoteControlInterface
19
15
{
20
16
/**
21
- * @var UserContextInterface $userContext
17
+ * @var UserContextInterface
22
18
*/
23
19
private $ userContext ;
24
20
@@ -31,25 +27,20 @@ public function __construct(UserContextInterface $userContext)
31
27
}
32
28
33
29
/**
34
- * { @inheritdoc}
30
+ * @inheritdoc
35
31
*/
36
32
public function isAllowed (CartInterface $ quote ): bool
37
33
{
38
34
switch ($ this ->userContext ->getUserType ()) {
39
35
case UserContextInterface::USER_TYPE_CUSTOMER :
40
- $ isAllowed = ($ quote ->getCustomerId () == $ this ->userContext ->getUserId ());
41
- break ;
36
+ return ($ quote ->getCustomerId () == $ this ->userContext ->getUserId ());
42
37
case UserContextInterface::USER_TYPE_GUEST :
43
- $ isAllowed = ($ quote ->getCustomerId () === null );
44
- break ;
38
+ return ($ quote ->getCustomerId () === null );
45
39
case UserContextInterface::USER_TYPE_ADMIN :
46
40
case UserContextInterface::USER_TYPE_INTEGRATION :
47
- $ isAllowed = true ;
48
- break ;
49
- default :
50
- $ isAllowed = false ;
41
+ return true ;
51
42
}
52
43
53
- return $ isAllowed ;
44
+ return false ;
54
45
}
55
46
}
You can’t perform that action at this time.
0 commit comments