@@ -22,7 +22,7 @@ class State
22
22
public function check (Order $ order )
23
23
{
24
24
$ currentState = $ order ->getState ();
25
- if ($ this ->canBeProcessingStatus ($ order , $ currentState )) {
25
+ if ($ this ->checkForProcessingState ($ order , $ currentState )) {
26
26
$ order ->setState (Order::STATE_PROCESSING )
27
27
->setStatus ($ order ->getConfig ()->getStateDefaultStatus (Order::STATE_PROCESSING ));
28
28
$ currentState = Order::STATE_PROCESSING ;
@@ -31,13 +31,13 @@ public function check(Order $order)
31
31
return $ this ;
32
32
}
33
33
34
- if ($ this ->canBeClosedStatus ($ order , $ currentState )) {
34
+ if ($ this ->checkForClosedState ($ order , $ currentState )) {
35
35
$ order ->setState (Order::STATE_CLOSED )
36
36
->setStatus ($ order ->getConfig ()->getStateDefaultStatus (Order::STATE_CLOSED ));
37
37
return $ this ;
38
38
}
39
39
40
- if ($ this ->canBeCompleteStatus ($ order , $ currentState )) {
40
+ if ($ this ->checkForCompleteState ($ order , $ currentState )) {
41
41
$ order ->setState (Order::STATE_COMPLETE )
42
42
->setStatus ($ order ->getConfig ()->getStateDefaultStatus (Order::STATE_COMPLETE ));
43
43
return $ this ;
@@ -47,13 +47,13 @@ public function check(Order $order)
47
47
}
48
48
49
49
/**
50
- * Check if order can be automatically switched to complete status
50
+ * Check if order can be automatically switched to complete state
51
51
*
52
52
* @param Order $order
53
53
* @param string|null $currentState
54
54
* @return bool
55
55
*/
56
- private function canBeCompleteStatus (Order $ order , ?string $ currentState ): bool
56
+ private function checkForCompleteState (Order $ order , ?string $ currentState ): bool
57
57
{
58
58
if ($ currentState === Order::STATE_PROCESSING && !$ order ->canShip ()) {
59
59
return true ;
@@ -63,13 +63,13 @@ private function canBeCompleteStatus(Order $order, ?string $currentState): bool
63
63
}
64
64
65
65
/**
66
- * Check if order can be automatically switched to closed status
66
+ * Check if order can be automatically switched to closed state
67
67
*
68
68
* @param Order $order
69
69
* @param string|null $currentState
70
70
* @return bool
71
71
*/
72
- private function canBeClosedStatus (Order $ order , ?string $ currentState ): bool
72
+ private function checkForClosedState (Order $ order , ?string $ currentState ): bool
73
73
{
74
74
if (in_array ($ currentState , [Order::STATE_PROCESSING , Order::STATE_COMPLETE ])
75
75
&& !$ order ->canCreditmemo ()
@@ -87,13 +87,13 @@ private function canBeClosedStatus(Order $order, ?string $currentState): bool
87
87
}
88
88
89
89
/**
90
- * Check if order can be automatically switched to processing status
90
+ * Check if order can be automatically switched to processing state
91
91
*
92
92
* @param Order $order
93
93
* @param string|null $currentState
94
94
* @return bool
95
95
*/
96
- private function canBeProcessingStatus (Order $ order , ?string $ currentState ): bool
96
+ private function checkForProcessingState (Order $ order , ?string $ currentState ): bool
97
97
{
98
98
if ($ currentState == Order::STATE_NEW && $ order ->getIsInProcess ()) {
99
99
return true ;
0 commit comments