File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed
app/code/Magento/Checkout Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change 30
30
use Psr \Log \LoggerInterface as Logger ;
31
31
32
32
/**
33
- * @inheritdoc
33
+ * Class checkout shipping information management
34
34
*
35
35
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
36
36
*/
@@ -224,11 +224,11 @@ public function saveAddressInformation(
224
224
/**
225
225
* Validate shipping address
226
226
*
227
- * @param AddressInterface $address
227
+ * @param AddressInterface|null $address
228
228
* @return void
229
229
* @throws StateException
230
230
*/
231
- private function validateAddress (AddressInterface $ address ): void
231
+ private function validateAddress (? AddressInterface $ address ): void
232
232
{
233
233
if (!$ address || !$ address ->getCountryId ()) {
234
234
throw new StateException (__ ('The shipping address is missing. Set the address and try again. ' ));
@@ -244,7 +244,7 @@ private function validateAddress(AddressInterface $address): void
244
244
*/
245
245
protected function validateQuote (Quote $ quote ): void
246
246
{
247
- if (! $ quote ->getItemsCount ()) {
247
+ if (0 === $ quote ->getItemsCount ()) {
248
248
throw new InputException (
249
249
__ ('The shipping method can \'t be set for an empty cart. Add an item to cart and try again. ' )
250
250
);
Original file line number Diff line number Diff line change @@ -43,36 +43,26 @@ class ShippingInformationManagementTest extends TestCase
43
43
{
44
44
/**
45
45
* Stub cart id
46
- *
47
- * @var int
48
46
*/
49
47
private const STUB_CART_ID = 100 ;
50
48
51
49
/**
52
50
* Stub items count
53
- *
54
- * @var int
55
51
*/
56
52
private const STUB_ITEMS_COUNT = 99 ;
57
53
58
54
/**
59
55
* Stub carrier code
60
- *
61
- * @var string
62
56
*/
63
57
private const STUB_CARRIER_CODE = 'carrier_code ' ;
64
58
65
59
/**
66
60
* Stub shipping method
67
- *
68
- * @var string
69
61
*/
70
62
private const STUB_SHIPPING_METHOD = 'shipping_method ' ;
71
63
72
64
/**
73
65
* Stub error message
74
- *
75
- * @var string
76
66
*/
77
67
private const STUB_ERROR_MESSAGE = 'error message ' ;
78
68
You can’t perform that action at this time.
0 commit comments