Skip to content

Commit 2668433

Browse files
requested changes
1 parent 9a1320b commit 2668433

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

app/code/Magento/Checkout/Model/ShippingInformationManagement.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
use Psr\Log\LoggerInterface as Logger;
3131

3232
/**
33-
* @inheritdoc
33+
* Class checkout shipping information management
3434
*
3535
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3636
*/
@@ -224,11 +224,11 @@ public function saveAddressInformation(
224224
/**
225225
* Validate shipping address
226226
*
227-
* @param AddressInterface $address
227+
* @param AddressInterface|null $address
228228
* @return void
229229
* @throws StateException
230230
*/
231-
private function validateAddress(AddressInterface $address): void
231+
private function validateAddress(?AddressInterface $address): void
232232
{
233233
if (!$address || !$address->getCountryId()) {
234234
throw new StateException(__('The shipping address is missing. Set the address and try again.'));
@@ -244,7 +244,7 @@ private function validateAddress(AddressInterface $address): void
244244
*/
245245
protected function validateQuote(Quote $quote): void
246246
{
247-
if (!$quote->getItemsCount()) {
247+
if (0 === $quote->getItemsCount()) {
248248
throw new InputException(
249249
__('The shipping method can\'t be set for an empty cart. Add an item to cart and try again.')
250250
);

app/code/Magento/Checkout/Test/Unit/Model/ShippingInformationManagementTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,36 +43,26 @@ class ShippingInformationManagementTest extends TestCase
4343
{
4444
/**
4545
* Stub cart id
46-
*
47-
* @var int
4846
*/
4947
private const STUB_CART_ID = 100;
5048

5149
/**
5250
* Stub items count
53-
*
54-
* @var int
5551
*/
5652
private const STUB_ITEMS_COUNT = 99;
5753

5854
/**
5955
* Stub carrier code
60-
*
61-
* @var string
6256
*/
6357
private const STUB_CARRIER_CODE = 'carrier_code';
6458

6559
/**
6660
* Stub shipping method
67-
*
68-
* @var string
6961
*/
7062
private const STUB_SHIPPING_METHOD = 'shipping_method';
7163

7264
/**
7365
* Stub error message
74-
*
75-
* @var string
7666
*/
7767
private const STUB_ERROR_MESSAGE = 'error message';
7868

0 commit comments

Comments
 (0)